SlideShare a Scribd company logo
Docker 101
Mirza Nafis Faysal
Software Engineer, Furqan Software
github.com/NafisFaysal
twitter.com/NafisFaysalMir
Motivation
● You only have to build the app once. Because a Docker app runs inside a container, and the
container can run on any system with Docker installed, there is no need to build the app and
configure it for multiple types of hardware platforms or operating systems where it will run. You
only have to build it once for Docker.
●
● You get greater consistency between testing environments and production environments.
When doing development with Docker, you test your app inside a container, and you ship it inside
a container. That means the environment in which you test is identical to the one in which the app
will run in production. As a result, developers can have much more confidence that end users
won't experience problems that the QA team missed when it was testing the app.
Session 1
Installing Docker on X Y Z -OS
Super Simple :
https://docs.docker.com/docker-for-mac/install/
https://docs.docker.com/engine/installation/linux/doc
ker-ce/ubuntu/
Docker 101
Docker.com Says
Docker is an open platform for developers and sysadmins
to build, ship, and run distributed applications.
Traditional VM Docker
They’redifferent,notmutuallyexclusive
Docker 101
Fancy Docker Terminology
Docker Image
Docker Container
Docker Engine
Docker Hub
Session 2
Docker Git
Image saved state Commit
Container used for local execution Checkout
Repository collection of commits Repository
Docker Hub popular remote server Github
Basic Docker Commands
$ docker pull
$ docker images
$ docker run –d –p –-name COMMAND
$ docker ps
$ docker stop containerName (or <container id>)
$ docker rm containerName (or <container id>)
Dockerfile
Series of commands to build an image
Command Description
ADD Copies a file from the host system onto the container
CMD The command that runs when the container starts
ENTRYPOINT
FROM The base image to use in the build. This is mandatory and must be the first command in the file.
ENV Sets an environment variable in the new container
EXPOSE Opens a port for linked containers
MAINTAINER An optional value for the maintainer of the script
ONBUILD A command that is triggered when the image in the Dockerfile is used as a base for another image
RUN Executes a command and save the result as a new layer
WORKDIR Set the default working directory for the container
Docker Compose : Get an app running in one command.
Session 3
‘’Compose is a tool for defining and running complex
applications with Docker. With Compose, you define
a multi-container application in a single file, then
spin your application up in a single command which
does everything that needs to be done to get it
running.’’
long story short
MOST COMMON DOCKER COMMANDS
Stop all containers: docker kill $(docker ps -q)
Remove all containers: docker rm $(docker ps -a -q)
Remove all docker images: docker rmi $(docker images -q)
container's IP address: docker inspect -f
'{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
Question ?
Happy Weekend

More Related Content

PDF
Docker how to
PPTX
Developer South Coast 2018: Modernizing .NET Apps with Docker
PDF
Azure Meetup Stuttgart - Multi-arch Docker images
PPTX
CI/CD Pipeline with Docker
PPTX
Docker containers on Windows
PDF
CI/CD with Docker on AWS
PDF
Automating AWS And Azure Resources with Octopus Deploy
PDF
Docker with Selenium by Thirumalai Vignesh
Docker how to
Developer South Coast 2018: Modernizing .NET Apps with Docker
Azure Meetup Stuttgart - Multi-arch Docker images
CI/CD Pipeline with Docker
Docker containers on Windows
CI/CD with Docker on AWS
Automating AWS And Azure Resources with Octopus Deploy
Docker with Selenium by Thirumalai Vignesh

What's hot (18)

PDF
Zalenium - SeleniumConf Austin 2017
PDF
Weekly lecture appsterdam_19mar2014
PPTX
Docker for a .NET web developer
PPTX
CloudExpo 2018: Docker - Power Your Move to the Cloud
PDF
Bauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
PPTX
Docker - A container full of Chocolatey
PPTX
Integration with Docker and .NET Core
ODP
Fedora Dockerfiles
PDF
Fedora docker
PPTX
Setup a Dev environment that feels like $HOME on Windows 10
PPTX
Docker Compose: Docker Configuration for the Real World
PDF
Docker notes for newbies
PDF
Introduction to Docker Compose | Docker Intermediate Workshop
PDF
Introduction to Containers and Docker for PHP developers
PDF
Seamless Continuous Deployment Using Docker Containers
PPTX
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDON
PDF
Docker cheat-sheet
PPTX
docker compose
Zalenium - SeleniumConf Austin 2017
Weekly lecture appsterdam_19mar2014
Docker for a .NET web developer
CloudExpo 2018: Docker - Power Your Move to the Cloud
Bauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
Docker - A container full of Chocolatey
Integration with Docker and .NET Core
Fedora Dockerfiles
Fedora docker
Setup a Dev environment that feels like $HOME on Windows 10
Docker Compose: Docker Configuration for the Real World
Docker notes for newbies
Introduction to Docker Compose | Docker Intermediate Workshop
Introduction to Containers and Docker for PHP developers
Seamless Continuous Deployment Using Docker Containers
Sentiment Analysis Dockerised Microservice using Stanford NLP and HELIDON
Docker cheat-sheet
docker compose
Ad

Similar to Docker 101 (20)

PDF
PDF
[@NaukriEngineering] Docker 101
PDF
Docker.pdf
PPTX
Primi passi con Docker - ItalianCoders - 12-01-2021
PPTX
Docker - A Quick Introduction Guide
PPTX
PPTX
Introduction to Docker by Techserverglobal
PPTX
Docker + Jelastic - planeetta.fi
PPTX
Docker
PDF
Dockers & kubernetes detailed - Beginners to Geek
PDF
Docker: A New Way to Turbocharging Your Apps Development
PPTX
Build Once, Run Anywhere: The Rise of Containerization in Modern IT
PDF
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PDF
Docker for Developers
PDF
PPSX
Docker and containers - Presentation Slides by Priyadarshini Anand
PDF
Docker in everyday development
PPTX
Getting Started With Docker: Simplifying DevOps
PPTX
tips for generating docker containers complaints with the devsecops
PPTX
Docker for .NET Developers
[@NaukriEngineering] Docker 101
Docker.pdf
Primi passi con Docker - ItalianCoders - 12-01-2021
Docker - A Quick Introduction Guide
Introduction to Docker by Techserverglobal
Docker + Jelastic - planeetta.fi
Docker
Dockers & kubernetes detailed - Beginners to Geek
Docker: A New Way to Turbocharging Your Apps Development
Build Once, Run Anywhere: The Rise of Containerization in Modern IT
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
Docker for Developers
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker in everyday development
Getting Started With Docker: Simplifying DevOps
tips for generating docker containers complaints with the devsecops
Docker for .NET Developers
Ad

Recently uploaded (20)

PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Sustainable Sites - Green Building Construction
PPT
Project quality management in manufacturing
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
composite construction of structures.pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Welding lecture in detail for understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Internet of Things (IOT) - A guide to understanding
Sustainable Sites - Green Building Construction
Project quality management in manufacturing
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Structs to JSON How Go Powers REST APIs.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
UNIT 4 Total Quality Management .pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
composite construction of structures.pdf
Foundation to blockchain - A guide to Blockchain Tech
CH1 Production IntroductoryConcepts.pptx
Welding lecture in detail for understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

Docker 101

  • 2. Mirza Nafis Faysal Software Engineer, Furqan Software github.com/NafisFaysal twitter.com/NafisFaysalMir
  • 3. Motivation ● You only have to build the app once. Because a Docker app runs inside a container, and the container can run on any system with Docker installed, there is no need to build the app and configure it for multiple types of hardware platforms or operating systems where it will run. You only have to build it once for Docker. ● ● You get greater consistency between testing environments and production environments. When doing development with Docker, you test your app inside a container, and you ship it inside a container. That means the environment in which you test is identical to the one in which the app will run in production. As a result, developers can have much more confidence that end users won't experience problems that the QA team missed when it was testing the app. Session 1
  • 4. Installing Docker on X Y Z -OS Super Simple : https://docs.docker.com/docker-for-mac/install/ https://docs.docker.com/engine/installation/linux/doc ker-ce/ubuntu/
  • 6. Docker.com Says Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications.
  • 9. Fancy Docker Terminology Docker Image Docker Container Docker Engine Docker Hub Session 2
  • 10. Docker Git Image saved state Commit Container used for local execution Checkout Repository collection of commits Repository Docker Hub popular remote server Github
  • 12. $ docker pull $ docker images $ docker run –d –p –-name COMMAND $ docker ps $ docker stop containerName (or <container id>) $ docker rm containerName (or <container id>)
  • 13. Dockerfile Series of commands to build an image
  • 14. Command Description ADD Copies a file from the host system onto the container CMD The command that runs when the container starts ENTRYPOINT FROM The base image to use in the build. This is mandatory and must be the first command in the file. ENV Sets an environment variable in the new container EXPOSE Opens a port for linked containers MAINTAINER An optional value for the maintainer of the script ONBUILD A command that is triggered when the image in the Dockerfile is used as a base for another image RUN Executes a command and save the result as a new layer WORKDIR Set the default working directory for the container
  • 15. Docker Compose : Get an app running in one command. Session 3
  • 16. ‘’Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.’’
  • 18. MOST COMMON DOCKER COMMANDS Stop all containers: docker kill $(docker ps -q) Remove all containers: docker rm $(docker ps -a -q) Remove all docker images: docker rmi $(docker images -q) container's IP address: docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id