SlideShare una empresa de Scribd logo
1 de 56
Descargar para leer sin conexión
@harbsprog
root@p0is0n ~ $ Whoami
● Student of the 3rd year of Systems Analysis and Development at IFSP - Campus BRT.
● Web Developer at Williarts.
● <3 - C#, VB.Net, PHP, CSS, JS, NodeJS, React, React Native.
● Twitter/GitHub: @harbsprog
● Areas of interest:
○ Information Security.
○ Programming.
○ Containers and DevOps Culture.
○ Monitoring.
root@p0is0n ~ $ Script
● What is Docker?
● What are Containers?
● What are Images?
● Brief History.
● Companies that use Docker.
● Install and Run Docker.
● Create and Run Container.
● Container interaction commands.
● Build Image.
root@p0is0n ~ $ What is Docker?
● Docker is an open-source platform written in GO whose purpose is to create
isolated environments for applications and services
● Allows you to create, run, test and deploy applications distributed within software
containers.
● Allows you to deploy applications quickly, reliably and stable, in any environment.
root@p0is0n ~ $ What are Containers?
root@p0is0n ~ $ What are Containers?
● Containers are a method of isolation at the operating system level, where the
kernel is shared between Containers and Physical Host.
● Ensure greater speed, reliability, consistency and more granular control of
resources, increasing infrastructure efficiency.
root@p0is0n ~ $ VM x Containers?
root@p0is0n ~ $ What are Images?
● A container is based on an image, which will load the libs and services required to
run your application.
● it is also possible to create images through some existing one.
● In addition to the images provided by the Docker store (http://bit.do/dockerhub),
you can create your own image through Dockerfile, which we'll see in the next
chapters.
● Docker Images Are Files Read Only.
root@p0is0n ~ $ What are Images?
root@p0is0n ~ $ Brief History About Docker
● The construction of docker was started by Solomon Hykes, in France, within the
company DotCloud in 2008.
● Docker was released as Open Source in March 2013.
● In March 2014 stopped using LXC as environment to use its own libcontainer,
written in GO language Created by Google.
root@p0is0n ~ $ Brief History About Containers
1979
Unix v7
2000
FreeBSD Jails
root@p0is0n ~ $ Brief History About Containers
2001
Linux VServer
2004
Oracle Solaris Container
root@p0is0n ~ $ Brief History About Containers
2006
Process Containers
2008
LXC
root@p0is0n ~ $ Brief History About Containers
2011
Warden
2013
Docker
root@p0is0n ~ $ Who Are We?
The Docker Project
Open Source Project
● 2B+ Docker Images Downloads
● 2000+ Contributors
● 40K+ Github Stars
● 200k+ Dockerized Apps
● 240 Meetups in 70 countries
● 95K Meetup Members
Docker Inc.
Containers as a Service provider
● Integrated platform for Dev and IT
● Commercial technical support
Docker project sponsor
● Primary sponsor of Docker project
● Supports project maintainers
root@p0is0n ~ $ Some Facts About Docker
● More than 500 thousand dockerized applications. Growth of 3100% over 2 years.
● Adoption of Docker has increased more than 30% in the last year.
● About 30% of docker containers are running in production.
● 29% of companies who have heard of Docker plan to use it.
● A January 2017 review of LinkedIn profiles shows that docker skills grew 160% in
2016.
● In Github there are almost 150,000 repositories with some code or something
related to Docker.
root@p0is0n ~ $ Companies that use Docker
Still not convinced to adopt the docker in your life?
root@p0is0n ~ $ Benefits
● Nothing more than "on my machine works".
● Rapid development environment configuration.
● Versioning of images.
● Run applications without compromising host resources.
● Keep multiple versions for testing purposes.
● Ensure that the development environment is equal to that of production.
root@p0is0n ~ $ DevOps
+ +
Dev Team Ops Team
root@p0is0n ~ $ No more ugly faces
root@p0is0n ~ $ Are u Ready?
root@p0is0n ~ $ Install Docker
Install Docker:
Init Docker:
Verify that you have started:
root@p0is0n ~ $ Run Docker (docker ps)
Run Docker (docker ps command):
CONTAINER ID: Id of Container.
IMAGE: Base Image.
COMMAND: Running Command.
CREATED: Time of existence.
STATUS: Is Working or Not.
PORTS: Directional doors.
NAMES: Name of container
root@p0is0n ~ $ Run Docker (docker images)
Run Docker (docker images command):
REPOSITORY: Name of Image Repository.
TAG: Image Version.
IMAGE ID: Id of Image.
CREATED: Time of existence.
SIZE: Size of Image.
root@p0is0n ~ $ Download Image (docker pull)
To download an image from dockerhub:
pull: Image Download Command.
IMAGEM: Name of Image.
VERSAO: Version of Image.
PS: comment about push command.
root@p0is0n ~ $ Create Container (docker run)
Run Docker (docker run command):
-i : Interactivity with the container.
-t : Link with terminal.
-p : Redirecting ports from the container to the host. 8080(host)|80(container)
IMAGENAME or ubuntu: : Image Repository.
TAG or 17.04 : Image Version
process /bin/bash(<- terminal): Process that would start running in the container.
root@p0is0n ~ $ Inside the Container
root@p0is0n ~ $ Inside the Container
Checking if you are inside the container:
Look, you are only running the /bin/bash process and ps -ef
Now you can test your applications, install programs, deploys ...
root@p0is0n ~ $ Container interaction commands
root@p0is0n ~ $ Container interaction commands
Ctrl + D : Closes the container.
Proving:
Ctrl + P + Q : Exit the container but it continues executing.
Proving:
root@p0is0n ~ $ Commands: attach and diff
To return to the container that is in the background:
CONTAINERID: Is the id of the running container you want to access.
To view the changes you have made since the container was created:
CONTAINERID: Is the id of the running container you want to access.
root@p0is0n ~ $ Commands: stop, pause and unpause
To stop the container:
To pause the container:
To unpause the container:
CONTAINERID: Is the id of the running container you want to access.
root@p0is0n ~ $ Commands: docker ps -a
Run Docker (docker ps -a command):
This command shows containers that have been closed or stopped.
root@p0is0n ~ $ Commands: top and logs
To view container logs:
To see how much a process is consuming:
CONTAINERID: Is the id of the running container you want to access.
root@p0is0n ~ $ Commands: stats
To see how much your container is consuming from the host:
CONTAINERID: Is the id of the running container you want to access.
Return:
root@p0is0n ~ $ Commands: inspect
To display information about the container:
CONTAINERID: Is the id of the running container you want to access.
root@p0is0n ~ $ Commands: inspect With Mem Info
To display information about container memory:
CONTAINERID: Is the id of the running container you want to access.
root@p0is0n ~ $ Commands: update - Limiting Memory
-m: option to add memory.
update command: The update command makes changes such as memory and CPU
even when the container is running
root@p0is0n ~ $ Commands: inspect With Cpu Info
To display information about container cpu:
CONTAINERID: Is the id of the running container you want to access.
root@p0is0n ~ $ Commands: update - Limiting Cpu
--cpu-shares: option to add cpu cores.
update command: The update command makes changes such as memory and CPU
even when the container is running
root@p0is0n ~ $ Commands: commit
To create an image and not lose your container when you turn it off:
Example:
Docker Images:
root@p0is0n ~ $ Commands: rm and rmi
To delete an image:
To delete an container:
-f : Force exclusion.
CONTAINERID: Is the id of the running container you want to access.
root@p0is0n ~ $ Create images with DockerFiles
root@p0is0n ~ $ DockerFiles (Step by step)
Why all this work if you can automate the creation of your images and containers with
DockerFiles? Ps. Similar to the C MakeFile.
root@p0is0n ~ $ DockerFiles (Step by step)
● Create a directory and place your dockerfile with the same directory name inside.
Important: One dockerfile per folder.
root@p0is0n ~ $ DockerFiles (Step by step)
root@p0is0n ~ $ DockerFiles (Step by step)
FROM: Base Image.
MAINTAINER: Name of maintainer, creator of image.
RUN: Applications to be installed, codes to be downloaded.
CMD: Processes to be started.
root@p0is0n ~ $ DockerFiles (Step by step)
● Creating your image from dockerfile:
If it is in the dockerfile directory, enter '. 'at the end otherwise the directory.
root@p0is0n ~ $ More More More ….
root@p0is0n ~ $ Orchestration Tools
● Rancher OS
● Amazon ECS
● Azure Containers Services
● Cloud Foundry’s Diego
● CoreOS Fleet
root@p0is0n ~ $ Orchestration Tools
● Docker Swarm - Clustering of multiple container images from multiple
docker-hosts.
● Docker Compose - Collaboration between containers as if it were a single service.
● Google Container Engine
● Kubernetes
root@p0is0n ~ $ Free Indications
Book:
Youtube:
● No Need to Know Anything about Docker.
● Free Here! -> http://bit.do/docker-devel
● LinuxTips Channel on Youtube From
Jefferson, Co- Founder of CodeOps_
● Content about Docker and Much More.
● Link: http://bit.do/linuxtips
root@p0is0n ~ $ Paid Indications
Books:
Book: Descomplicando o Docker
Authors: Vitalino, Jeferson Fernando Noronha.
Castro, Marcus André Nunes.
Publishing company: BRASPORT.
Book: Aprendendo o Docker
Authors:
Da Silva, Wellington Figueira.
Publishing company: Novatec.
root@p0is0n ~ $ Paid Indications
Books:
Book: Containers com Docker, do
Desenvolvimento a produção
Authors: Romero, Daniel.
Publishing company: Casa do Código.
root@p0is0n ~ $ Thx

Más contenido relacionado

La actualidad más candente

Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersBen Hall
 
Docker for Fun and Profit, Devoxx 2014
Docker for Fun and Profit, Devoxx 2014Docker for Fun and Profit, Devoxx 2014
Docker for Fun and Profit, Devoxx 2014Carl Quinn
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and PracticeBo-Yi Wu
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersAnthony Chu
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachPROIDEA
 
Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Ruoshi Ling
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowJosé Paumard
 
Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Toby Griffiths
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Workhorse Computing
 
Docker & PHP - Practical use case
Docker & PHP - Practical use caseDocker & PHP - Practical use case
Docker & PHP - Practical use caserjsmelo
 
EC2 Storage for Docker 150526b
EC2 Storage for Docker   150526bEC2 Storage for Docker   150526b
EC2 Storage for Docker 150526bClinton Kitson
 
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊Po-Jen Lai
 
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Dockermsyukor
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applicationsTerry Chen
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with dockerGiacomo Bagnoli
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peekmsyukor
 

La actualidad más candente (20)

Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containers
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
Docker for Fun and Profit, Devoxx 2014
Docker for Fun and Profit, Devoxx 2014Docker for Fun and Profit, Devoxx 2014
Docker for Fun and Profit, Devoxx 2014
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server Containers
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)
 
Docker
DockerDocker
Docker
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.
 
Docker & PHP - Practical use case
Docker & PHP - Practical use caseDocker & PHP - Practical use case
Docker & PHP - Practical use case
 
EC2 Storage for Docker 150526b
EC2 Storage for Docker   150526bEC2 Storage for Docker   150526b
EC2 Storage for Docker 150526b
 
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Docker
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applications
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 

Similar a Docker Fundamentals: Containers, Images, Commands and Dockerfiles

Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016XP Conference India
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with DockerPatrick Mizer
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020CloudHero
 
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik DornJDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik DornPROIDEA
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageAlessandro Cinelli (cirpo)
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxIgnacioTamayo2
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
Docker and the Container Revolution
Docker and the Container RevolutionDocker and the Container Revolution
Docker and the Container RevolutionRomain Dorgueil
 
Containers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkContainers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkRed Hat Developers
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandPRIYADARSHINI ANAND
 

Similar a Docker Fundamentals: Containers, Images, Commands and Dockerfiles (20)

Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
Docker 101
Docker 101Docker 101
Docker 101
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik DornJDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
 
Docker Starter Pack
Docker Starter PackDocker Starter Pack
Docker Starter Pack
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker basic
Docker basicDocker basic
Docker basic
 
Docker
DockerDocker
Docker
 
Docker and the Container Revolution
Docker and the Container RevolutionDocker and the Container Revolution
Docker and the Container Revolution
 
Containers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkContainers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech Talk
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 

Último

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Último (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Docker Fundamentals: Containers, Images, Commands and Dockerfiles

  • 2. root@p0is0n ~ $ Whoami ● Student of the 3rd year of Systems Analysis and Development at IFSP - Campus BRT. ● Web Developer at Williarts. ● <3 - C#, VB.Net, PHP, CSS, JS, NodeJS, React, React Native. ● Twitter/GitHub: @harbsprog ● Areas of interest: ○ Information Security. ○ Programming. ○ Containers and DevOps Culture. ○ Monitoring.
  • 3. root@p0is0n ~ $ Script ● What is Docker? ● What are Containers? ● What are Images? ● Brief History. ● Companies that use Docker. ● Install and Run Docker. ● Create and Run Container. ● Container interaction commands. ● Build Image.
  • 4. root@p0is0n ~ $ What is Docker? ● Docker is an open-source platform written in GO whose purpose is to create isolated environments for applications and services ● Allows you to create, run, test and deploy applications distributed within software containers. ● Allows you to deploy applications quickly, reliably and stable, in any environment.
  • 5. root@p0is0n ~ $ What are Containers?
  • 6. root@p0is0n ~ $ What are Containers? ● Containers are a method of isolation at the operating system level, where the kernel is shared between Containers and Physical Host. ● Ensure greater speed, reliability, consistency and more granular control of resources, increasing infrastructure efficiency.
  • 7. root@p0is0n ~ $ VM x Containers?
  • 8. root@p0is0n ~ $ What are Images? ● A container is based on an image, which will load the libs and services required to run your application. ● it is also possible to create images through some existing one. ● In addition to the images provided by the Docker store (http://bit.do/dockerhub), you can create your own image through Dockerfile, which we'll see in the next chapters. ● Docker Images Are Files Read Only.
  • 9. root@p0is0n ~ $ What are Images?
  • 10. root@p0is0n ~ $ Brief History About Docker ● The construction of docker was started by Solomon Hykes, in France, within the company DotCloud in 2008. ● Docker was released as Open Source in March 2013. ● In March 2014 stopped using LXC as environment to use its own libcontainer, written in GO language Created by Google.
  • 11. root@p0is0n ~ $ Brief History About Containers 1979 Unix v7 2000 FreeBSD Jails
  • 12. root@p0is0n ~ $ Brief History About Containers 2001 Linux VServer 2004 Oracle Solaris Container
  • 13. root@p0is0n ~ $ Brief History About Containers 2006 Process Containers 2008 LXC
  • 14. root@p0is0n ~ $ Brief History About Containers 2011 Warden 2013 Docker
  • 15. root@p0is0n ~ $ Who Are We? The Docker Project Open Source Project ● 2B+ Docker Images Downloads ● 2000+ Contributors ● 40K+ Github Stars ● 200k+ Dockerized Apps ● 240 Meetups in 70 countries ● 95K Meetup Members Docker Inc. Containers as a Service provider ● Integrated platform for Dev and IT ● Commercial technical support Docker project sponsor ● Primary sponsor of Docker project ● Supports project maintainers
  • 16. root@p0is0n ~ $ Some Facts About Docker ● More than 500 thousand dockerized applications. Growth of 3100% over 2 years. ● Adoption of Docker has increased more than 30% in the last year. ● About 30% of docker containers are running in production. ● 29% of companies who have heard of Docker plan to use it. ● A January 2017 review of LinkedIn profiles shows that docker skills grew 160% in 2016. ● In Github there are almost 150,000 repositories with some code or something related to Docker.
  • 17. root@p0is0n ~ $ Companies that use Docker
  • 18. Still not convinced to adopt the docker in your life?
  • 19. root@p0is0n ~ $ Benefits ● Nothing more than "on my machine works". ● Rapid development environment configuration. ● Versioning of images. ● Run applications without compromising host resources. ● Keep multiple versions for testing purposes. ● Ensure that the development environment is equal to that of production.
  • 20. root@p0is0n ~ $ DevOps + + Dev Team Ops Team
  • 21. root@p0is0n ~ $ No more ugly faces
  • 22. root@p0is0n ~ $ Are u Ready?
  • 23. root@p0is0n ~ $ Install Docker Install Docker: Init Docker: Verify that you have started:
  • 24. root@p0is0n ~ $ Run Docker (docker ps) Run Docker (docker ps command): CONTAINER ID: Id of Container. IMAGE: Base Image. COMMAND: Running Command. CREATED: Time of existence. STATUS: Is Working or Not. PORTS: Directional doors. NAMES: Name of container
  • 25. root@p0is0n ~ $ Run Docker (docker images) Run Docker (docker images command): REPOSITORY: Name of Image Repository. TAG: Image Version. IMAGE ID: Id of Image. CREATED: Time of existence. SIZE: Size of Image.
  • 26. root@p0is0n ~ $ Download Image (docker pull) To download an image from dockerhub: pull: Image Download Command. IMAGEM: Name of Image. VERSAO: Version of Image. PS: comment about push command.
  • 27. root@p0is0n ~ $ Create Container (docker run) Run Docker (docker run command): -i : Interactivity with the container. -t : Link with terminal. -p : Redirecting ports from the container to the host. 8080(host)|80(container) IMAGENAME or ubuntu: : Image Repository. TAG or 17.04 : Image Version process /bin/bash(<- terminal): Process that would start running in the container.
  • 28. root@p0is0n ~ $ Inside the Container
  • 29. root@p0is0n ~ $ Inside the Container Checking if you are inside the container: Look, you are only running the /bin/bash process and ps -ef Now you can test your applications, install programs, deploys ...
  • 30. root@p0is0n ~ $ Container interaction commands
  • 31. root@p0is0n ~ $ Container interaction commands Ctrl + D : Closes the container. Proving: Ctrl + P + Q : Exit the container but it continues executing. Proving:
  • 32. root@p0is0n ~ $ Commands: attach and diff To return to the container that is in the background: CONTAINERID: Is the id of the running container you want to access. To view the changes you have made since the container was created: CONTAINERID: Is the id of the running container you want to access.
  • 33. root@p0is0n ~ $ Commands: stop, pause and unpause To stop the container: To pause the container: To unpause the container: CONTAINERID: Is the id of the running container you want to access.
  • 34. root@p0is0n ~ $ Commands: docker ps -a Run Docker (docker ps -a command): This command shows containers that have been closed or stopped.
  • 35. root@p0is0n ~ $ Commands: top and logs To view container logs: To see how much a process is consuming: CONTAINERID: Is the id of the running container you want to access.
  • 36. root@p0is0n ~ $ Commands: stats To see how much your container is consuming from the host: CONTAINERID: Is the id of the running container you want to access. Return:
  • 37. root@p0is0n ~ $ Commands: inspect To display information about the container: CONTAINERID: Is the id of the running container you want to access.
  • 38. root@p0is0n ~ $ Commands: inspect With Mem Info To display information about container memory: CONTAINERID: Is the id of the running container you want to access.
  • 39. root@p0is0n ~ $ Commands: update - Limiting Memory -m: option to add memory. update command: The update command makes changes such as memory and CPU even when the container is running
  • 40. root@p0is0n ~ $ Commands: inspect With Cpu Info To display information about container cpu: CONTAINERID: Is the id of the running container you want to access.
  • 41. root@p0is0n ~ $ Commands: update - Limiting Cpu --cpu-shares: option to add cpu cores. update command: The update command makes changes such as memory and CPU even when the container is running
  • 42. root@p0is0n ~ $ Commands: commit To create an image and not lose your container when you turn it off: Example: Docker Images:
  • 43. root@p0is0n ~ $ Commands: rm and rmi To delete an image: To delete an container: -f : Force exclusion. CONTAINERID: Is the id of the running container you want to access.
  • 44. root@p0is0n ~ $ Create images with DockerFiles
  • 45. root@p0is0n ~ $ DockerFiles (Step by step) Why all this work if you can automate the creation of your images and containers with DockerFiles? Ps. Similar to the C MakeFile.
  • 46. root@p0is0n ~ $ DockerFiles (Step by step) ● Create a directory and place your dockerfile with the same directory name inside. Important: One dockerfile per folder.
  • 47. root@p0is0n ~ $ DockerFiles (Step by step)
  • 48. root@p0is0n ~ $ DockerFiles (Step by step) FROM: Base Image. MAINTAINER: Name of maintainer, creator of image. RUN: Applications to be installed, codes to be downloaded. CMD: Processes to be started.
  • 49. root@p0is0n ~ $ DockerFiles (Step by step) ● Creating your image from dockerfile: If it is in the dockerfile directory, enter '. 'at the end otherwise the directory.
  • 50. root@p0is0n ~ $ More More More ….
  • 51. root@p0is0n ~ $ Orchestration Tools ● Rancher OS ● Amazon ECS ● Azure Containers Services ● Cloud Foundry’s Diego ● CoreOS Fleet
  • 52. root@p0is0n ~ $ Orchestration Tools ● Docker Swarm - Clustering of multiple container images from multiple docker-hosts. ● Docker Compose - Collaboration between containers as if it were a single service. ● Google Container Engine ● Kubernetes
  • 53. root@p0is0n ~ $ Free Indications Book: Youtube: ● No Need to Know Anything about Docker. ● Free Here! -> http://bit.do/docker-devel ● LinuxTips Channel on Youtube From Jefferson, Co- Founder of CodeOps_ ● Content about Docker and Much More. ● Link: http://bit.do/linuxtips
  • 54. root@p0is0n ~ $ Paid Indications Books: Book: Descomplicando o Docker Authors: Vitalino, Jeferson Fernando Noronha. Castro, Marcus André Nunes. Publishing company: BRASPORT. Book: Aprendendo o Docker Authors: Da Silva, Wellington Figueira. Publishing company: Novatec.
  • 55. root@p0is0n ~ $ Paid Indications Books: Book: Containers com Docker, do Desenvolvimento a produção Authors: Romero, Daniel. Publishing company: Casa do Código.