SlideShare a Scribd company logo
1 of 58
Download to read offline
Docker Up and Running for Web
Developers
Amr Fawzy Mohammed
Outline
● What is Docker ?
● Docker Overview
● Why Docker ?
● What is the Docker platform ?
● Union file systems
● What happens when you run a container ?
● Install Docker
● Managing Images and Containers
● Docker Networking
● Get source code into a Container
● Volumes
● Communication between Containers
● First we need to know what Containers actually are or
what they bring to the table, in order to do this we
need to briefly review the history of an application's
runtime environment.
What is Docker ?
● In the beginning we used to build applications directly
on physical servers in 1:1 ratio.
Application's Runtime Environment
● Disadvantages of this technique:
○ Every application requires a ton of infrastructure.
○ It takes a lot of time to deploy or scale an app.
○ Financially, that was a highly expensive.
○ It causes massive waste of resources.
■ Most of the time these servers run at a tiny fraction of their
capabilities.
Application's Runtime Environment cont.
● This solution was not meant to be last for a long time.
● Virtualization takes place.
Application's Runtime Environment cont.
● Virtualization technology
enables to build multiple
virtual machines on top
of a physical machine
which means running
multiple applications on
top of a single physical
server.
Application's Runtime Environment cont.
Application's Runtime Environment cont.
● Each virtual machine has it's own OS which is
considered a huge overhead and a massive waste of the
host physical machine's resources.
Application's Runtime Environment cont.
● The efficient solution
was using Containers.
Application's Runtime Environment cont.
● Containers are way more lightweight than Virtual
machines (no Guest OS).
● Each Container consumes less CPU,RAM,Disk space than
a VM, But still provides a secure isolated runtime
environment for the application.
Application's Runtime Environment cont.
Application's Runtime Environment cont.
● Technologies that allow you to package and isolate
applications from the rest of the system.
● Containers make it easy to Deploy Applications without
massive headaches, rewriting, and break-fixing.
What are containers ?
● Chroot system call
○ Seeds for today’s containers were planted in 1979 with the
addition of the chroot system call to Version 7 Unix.
● FreeBSD jail
○ In 2000, FreeBSD 4.0 was released with a new command called
jail which expanded chroot’s capabilities.
A brief history of containers
● Solaris Zones
○ In 2004, Sun released an early build of Solaris 10, which
included Solaris Containers, and later evolved into Solaris
Zones.
● HP-UX Containers
○ In 2007, HP released Secure Resource Partitions for HP-UX later
renamed to HP-UX Containers.
A brief history of containers cont.
● Linux Containers (LXC)
○ In 2008, Linux Containers (LXC) were released in version 2.6.24
of the Linux kernel.
● Docker
○ In 2013, the phenomenal growth of Linux Containers starts to
grow with the inclusion of user namespaces in version 3.8 of
the Linux Kernel and the release of Docker one month later.
A brief history of containers cont.
● Docker is a platform for Developers and System Admins
to develop, ship, and run applications.
● Docker provides the ability to package and run an
application in a loosely isolated secured environment
called a container.
Docker Overview
● Faster delivery of your applications.
● Faster deployment makes for easier management.
○ Docker speeds up the work flow, so it gets easier to make lots of
small changes instead of huge updates.
○ Smaller changes mean reduced risk and more uptime.
Why Docker ?
● Docker helps developers to care about their
applications inside containers while sysadmins work on
running the container in your deployment.
● “This separation of duties streamlines and simplifies
the management and deployment of code”
Why Docker ? Cont.
● Deploy and scale more easily.
● Docker containers run (almost) everywhere.
● Ensure consistency between environments.
Why Docker ? Cont.
● We can run more containers on a given hardware
combination than if you were using virtual machines.
Why Docker ? Cont.
● Eliminate applications conflicts.
● Less OS maintenance (only the host OS).
● Ultimate portability between multiple environment.
● Setup development environment very quickly.
● Ship software faster.
● Fast deployment.
● Allows very easy scalability.
● Opens massive opportunities for automated testing.
● Moves control of the environment to the development
team.
Summarizing Docker Benefits
● Docker provides a platform to manage the lifecycle of
your containers:
○ Encapsulate your applications into Docker containers.
○ Distribute and ship those containers to your teams for further
development and testing.
○ Deploy those applications to your production environment.
What is the Docker platform ?
● Docker Engine
○ lightweight and powerful open source container virtualization
technology combined with a workflow for building and
containerizing applications.
● Docker Registries
Docker Platform Components
Docker Platform architecture
● A client-server application with these major
components:
○ Server (docker daemon)
○ A REST API
○ Client (CLI)
Docker Engine
● The Docker daemon runs on a host machine.
● The user uses the Docker client to interact with the
daemon.
● The daemon creates and manages Docker objects, such
as images, containers, networks, and data volumes.
Docker Daemon
● In the form of the docker binary.
● It accepts commands from the user and communicates
with the Docker daemon.
● One client can communicate with multiple unrelated
daemons.
Docker Client
● Union file systems allow files and directories of
separate file systems, known as branches, to be
transparently overlaid, forming a single coherent file
system.
● Docker uses union file systems to combine these layers
into a single image.
Union file systems
Union file systems cont.
● These layers are one of the reasons Docker is so
lightweight.
○ When you change a Docker image, a new layer is built and
replaces only the layer it updates.
○ To distribute the update, you only need to transfer the updated
layer.
● Layering speeds up distribution of Docker images.
● A docker image is a read-only template.
● Docker images are the basis of the Docker containers.
● Docker images are the build component of Docker.
● You can build images from scratch or download and use
images created by others.
Docker images
● Dockerfile is a text document that contains all the
commands and instructions that Docker can use to
automatically build images.
● Every image starts from a base image such as ubuntu,
fedora or an image of your own such as Apache, Nginx,
Ruby, etc.
Dockerfile
Dockerfile cont.
● Each instruction in the Dockerfile creates a new layer
in the image.
● Each image consists of a series of layers.
● Creating Image from Dockerfile
○ sudo docker build -t $image_name .
● FROM : Specify the base image
● MAINTAINER : Specify the image maintainer
● RUN : Run a command
● ADD : Add a file or directory
● EXPOSE : expose ports to be accessed
● ENV : Create an environment variable
● CMD : What process to run when launching a container
from this image.
Some Dockerfile instructions
● A Docker container is a runnable instance of a Docker
image.
● You can run, start, stop, move, or delete a container
using Docker CLI commands.
● Docker containers are the run component of Docker.
Docker containers
Images, Containers and layers
● A docker registry is a library of images.
● A registry can be public or private.
● Can be on the same server as the Docker daemon or
Docker client, or on a totally separate server.
● Docker registries are the distribution component of
Docker.
Docker registries
● $ docker run -i -t ubuntu /bin/bash
● This command tells the Docker daemon to create and
start a container using the ubuntu image, run it in an
interactive mode (-i),Allocate a pseudo-TTY and to run
the /bin/bash command.
● So, what actually the Engine does behind the scene ?!
What happens when you run a container ?
● Pulls the ubuntu image.
● Creates a new container.
● Allocates a filesystem and mounts a read-write layer.
● Allocates a network / bridge interface.
● Sets up an IP address.
● Executes the /bin/bash executable.
● Captures and provides application output.
○ (due to interactive mode)
What happens when you run a container?
Cont.
● Docker Engine is supported on Linux, Cloud, Windows,
and macOS.
● For Linux use the script on this link :
− https://get.docker.com/
● For Windows or Mac Docker can be installed using
Docker Toolbox
Install Docker
● Consists of :
○ Docker Client
○ Docker Machine
○ Docker kitematic
○ Docker Compose
Docker toolbox
● Docker machine is a tool that can be used to
○ Create Docker hosts on your Mac or Windows box, on your
company network, in your data center, or on cloud providers.
○ Manage this host (start,stop,restart,..etc).
○ Upgrade the Docker client and daemon.
○ Configure a Docker client to talk to your host.
Docker Machine
● docker-machine ls
● docker-machine start vm-name
● docker-machine stop vm-name
● docker-machine env vm-name
● docker-machine ip vm-name
Docker Machine cont.
● sudo docker search $image_name
○ Search for an image on Docker hub repository.
● sudo docker pull $image_name
○ Pull the required image from docker hub repository.
○ Update the installed images if there is any new updates.
● sudo docker images
○ List all images on the system.
● sudo docker rmi $image_name
○ Remove an image.
Managing Images and Containers
● sudo docker run --name $cont_name -d
$image_name
○ Spin up a container from an image and make it run in the
background.
● sudo docker ps
○ List the currently running containers.
● sudo docker ps -a
○ List all the containers whether they are running or not.
Managing Images and Containers cont.
● sudo docker rm $container_name
○ Remove a stopped container.
● sudo docker rm -f $container_name
○ Force remove a container.
● sudo docker stop $container_name
○ Stop a running container.
● sudo docker inspect $container_name OR
$image_name
○ This displays all the information available in Docker for a given
container or image.
Managing Images and Containers cont.
● sudo docker exec -it $container_name
<command>
○ Attach to the the running container.
○ Modify this running container.
● sudo docker commit $container_name
$image_name
○ Commit the modified container into image.
Creating Image from a modified container
● When Docker creates a
container, it creates two
virtual interfaces, one of
which sits on the
server-side and is
attached to the docker0
bridge, and one that is
exposed into the
container’s namespace.
Docker Networking
● sudo docker run -d -p 8080 $image_name
○ Port mapping.
○ Publish port 8080 from inside the container to the docker Host
on a random port (say 1234), So that the app running on port
8080 inside the container will be accessed through the host IP
on that random port.
● sudo docker run -d -p 3000:8080 $image_name
○ Port redirection.
○ Publish port 8080 from inside the container to the docker Host
on port 3000.
Docker Networking cont.
Docker Networking cont.
● sudo docker run -d --net=host $image_name
○ Host Networking.
○ Share the host IP address.
● sudo docker inspect $container_name | grep
IPAddress
○ Get the IP Address of the running container.
Inbound and Outbound Traffic
● Create a container volume that points to the source
code.
● Add your source code into a custom image that is used
to create a container.
Get source code into a Container
● A special type of directories in a container typically
referred to as a “data volume”.
● Can be shared and reused among containers.
Volumes
Volumes cont.
● sudo docker create --name mydataContainer
-v /usr/share/nginx/html ubuntu:latest
● sudo docker run --name
mywebserverContainer --volumes-from
mydataContainer -d nginx
● Sudo docker run --name myApp -p 8080:3000
-v /local/fs/path/:/container/fs/path -w
“/var/www” -d node npm start
Communication between Containers
● Linking containers with names by using --link option
○ sudo docker run --name myMongodbContainer -d mongo
○ sudo docker run --name railsAppContainer -p
3005:3000 --link myMongodbContainer:mongodbContainer
-d afawzy/integrationImage
Communication between Containers
● Create a custom bridge network and add containers
into it.
○ sudo docker network create --driver bridge
isolated_network
○ sudo docker run --name mongodbContainer
--net=isolated_network -d mongo
○ sudo docker run --name railsAppContainer
-p3005:3000 --net=isolated_network -d
afawzy/integrationImage
References
● https://docs.docker.com/
● man docker
● Docker: Up & Running: Shipping Reliable Containers in Production
● Docker: Intro - CBT Nuggets
● Docker for Web Developers - Pluralsight
● Docker Deep Dive - Pluralsight
● Learn how to deploy Docker applications to production - udemy

More Related Content

What's hot

Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.jsTechMagic
 
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWDEWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWDRob Tweed
 
3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don'tF5 Buddy
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An IntroductionNirvanic Labs
 
Node js training (1)
Node js training (1)Node js training (1)
Node js training (1)Ashish Gupta
 
EWD 3 Training Course Part 27: The QEWD Session
EWD 3 Training Course Part 27: The QEWD SessionEWD 3 Training Course Part 27: The QEWD Session
EWD 3 Training Course Part 27: The QEWD SessionRob Tweed
 
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sailsBrian Shannon
 
Nuxeo and JavaScript
Nuxeo and JavaScriptNuxeo and JavaScript
Nuxeo and JavaScriptNuxeo
 
[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLI
[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLI[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLI
[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLINuxeo
 
Fixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingFixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingIgalia
 
Node.js an introduction
Node.js   an introductionNode.js   an introduction
Node.js an introductionMeraj Khattak
 
An introduction to knockout.js
An introduction to knockout.jsAn introduction to knockout.js
An introduction to knockout.jsEmanuele DelBono
 
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash CourseHaim Michael
 
Introduction to Knockoutjs
Introduction to KnockoutjsIntroduction to Knockoutjs
Introduction to Knockoutjsjhoguet
 

What's hot (20)

Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWDEWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
 
3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An Introduction
 
Node js training (1)
Node js training (1)Node js training (1)
Node js training (1)
 
EWD 3 Training Course Part 27: The QEWD Session
EWD 3 Training Course Part 27: The QEWD SessionEWD 3 Training Course Part 27: The QEWD Session
EWD 3 Training Course Part 27: The QEWD Session
 
Lesson 09
Lesson 09Lesson 09
Lesson 09
 
Node js
Node jsNode js
Node js
 
Node js first look - 2016
Node js first look - 2016Node js first look - 2016
Node js first look - 2016
 
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sails
 
Nuxeo and JavaScript
Nuxeo and JavaScriptNuxeo and JavaScript
Nuxeo and JavaScript
 
Nodejs server lesson 3
 Nodejs server lesson 3 Nodejs server lesson 3
Nodejs server lesson 3
 
Nodejs
NodejsNodejs
Nodejs
 
[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLI
[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLI[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLI
[Nuxeo World 2013] XML EXTENSION POINT COMPLETION IN NUXEO IDE - SUN TAN, SERLI
 
Fixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingFixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blocking
 
Node js Global Packages
Node js Global PackagesNode js Global Packages
Node js Global Packages
 
Node.js an introduction
Node.js   an introductionNode.js   an introduction
Node.js an introduction
 
An introduction to knockout.js
An introduction to knockout.jsAn introduction to knockout.js
An introduction to knockout.js
 
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
 
Introduction to Knockoutjs
Introduction to KnockoutjsIntroduction to Knockoutjs
Introduction to Knockoutjs
 

Viewers also liked

Explicit Semantic Analysis
Explicit Semantic AnalysisExplicit Semantic Analysis
Explicit Semantic AnalysisBADR
 
Concept-Based Information Retrieval using Explicit Semantic Analysis
Concept-Based Information Retrieval using Explicit Semantic AnalysisConcept-Based Information Retrieval using Explicit Semantic Analysis
Concept-Based Information Retrieval using Explicit Semantic AnalysisOfer Egozi
 
Concept based information retrieval using explicit
Concept based information retrieval using explicitConcept based information retrieval using explicit
Concept based information retrieval using explicitnadikari123
 
Case study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemCase study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemKumar Amit Mehta
 
Sunspot - The Ruby Way into Solr
Sunspot - The Ruby Way into SolrSunspot - The Ruby Way into Solr
Sunspot - The Ruby Way into SolrBADR
 
File system Os
File system OsFile system Os
File system OsNehal Naik
 
I want to know more about compuerized text analysis
I want to know more about   compuerized text analysisI want to know more about   compuerized text analysis
I want to know more about compuerized text analysisLuke Czarnecki
 
New concept Information systems
New concept Information systemsNew concept Information systems
New concept Information systemsmohanraj123
 
File system.
File system.File system.
File system.elyza12
 
Presentación de sistemas
Presentación de sistemasPresentación de sistemas
Presentación de sistemascarlosfacade
 
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...INOCENCIO MELÉNDEZ JULIO
 
Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...
Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...
Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...INOCENCIO MELÉNDEZ JULIO
 
Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...
Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...
Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...INOCENCIO MELÉNDEZ JULIO
 
Studenten helfen schülern
Studenten helfen schülernStudenten helfen schülern
Studenten helfen schülernurmle
 
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...INOCENCIO MELÉNDEZ JULIO
 
IBS QMS:forum MES MOM Rottweil 01.10.2015
IBS QMS:forum MES MOM Rottweil 01.10.2015IBS QMS:forum MES MOM Rottweil 01.10.2015
IBS QMS:forum MES MOM Rottweil 01.10.2015Tanja Böttcher
 
La contabilidad como herramienta de la administración y gerencia de la empre...
La contabilidad como herramienta de la administración y gerencia de la empre...La contabilidad como herramienta de la administración y gerencia de la empre...
La contabilidad como herramienta de la administración y gerencia de la empre...INOCENCIO MELÉNDEZ JULIO
 
Angemessene Lüftungskonzepte bei der Erneuerung von Wohnbauten
Angemessene Lüftungskonzepte bei der Erneuerung von WohnbautenAngemessene Lüftungskonzepte bei der Erneuerung von Wohnbauten
Angemessene Lüftungskonzepte bei der Erneuerung von WohnbautenVorname Nachname
 

Viewers also liked (20)

Explicit Semantic Analysis
Explicit Semantic AnalysisExplicit Semantic Analysis
Explicit Semantic Analysis
 
Concept-Based Information Retrieval using Explicit Semantic Analysis
Concept-Based Information Retrieval using Explicit Semantic AnalysisConcept-Based Information Retrieval using Explicit Semantic Analysis
Concept-Based Information Retrieval using Explicit Semantic Analysis
 
Concept based information retrieval using explicit
Concept based information retrieval using explicitConcept based information retrieval using explicit
Concept based information retrieval using explicit
 
Case study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemCase study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File system
 
Sunspot - The Ruby Way into Solr
Sunspot - The Ruby Way into SolrSunspot - The Ruby Way into Solr
Sunspot - The Ruby Way into Solr
 
File system Os
File system OsFile system Os
File system Os
 
I want to know more about compuerized text analysis
I want to know more about   compuerized text analysisI want to know more about   compuerized text analysis
I want to know more about compuerized text analysis
 
New concept Information systems
New concept Information systemsNew concept Information systems
New concept Information systems
 
File system.
File system.File system.
File system.
 
Presentación de sistemas
Presentación de sistemasPresentación de sistemas
Presentación de sistemas
 
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
 
Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...
Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...
Inocencio meléndez julio. idujuridico. la comprensión y desarrollo de inves...
 
Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...
Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...
Inocencio meléndez julio. bogotá. importancia de los costos y presupuestos ...
 
Justus in New York
Justus in New YorkJustus in New York
Justus in New York
 
Studenten helfen schülern
Studenten helfen schülernStudenten helfen schülern
Studenten helfen schülern
 
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
Inocencio meléndez julio. cuenta, balance general y estado de resultados. in...
 
IBS QMS:forum MES MOM Rottweil 01.10.2015
IBS QMS:forum MES MOM Rottweil 01.10.2015IBS QMS:forum MES MOM Rottweil 01.10.2015
IBS QMS:forum MES MOM Rottweil 01.10.2015
 
Redes sociales
Redes socialesRedes sociales
Redes sociales
 
La contabilidad como herramienta de la administración y gerencia de la empre...
La contabilidad como herramienta de la administración y gerencia de la empre...La contabilidad como herramienta de la administración y gerencia de la empre...
La contabilidad como herramienta de la administración y gerencia de la empre...
 
Angemessene Lüftungskonzepte bei der Erneuerung von Wohnbauten
Angemessene Lüftungskonzepte bei der Erneuerung von WohnbautenAngemessene Lüftungskonzepte bei der Erneuerung von Wohnbauten
Angemessene Lüftungskonzepte bei der Erneuerung von Wohnbauten
 

Similar to Docker up and Running For Web Developers

Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataInfluxData
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerEric Smalling
 
Docker on Power Systems
Docker on Power SystemsDocker on Power Systems
Docker on Power SystemsCesar Maciel
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tipsSamuel Chow
 
Introduction to docker and docker compose
Introduction to docker and docker composeIntroduction to docker and docker compose
Introduction to docker and docker composeLalatendu Mohanty
 
Docker for developers
Docker for developersDocker for developers
Docker for developersAnvay Patil
 
Docker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container worldDocker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container worldzekeLabs Technologies
 
Docker for developers
Docker for developersDocker for developers
Docker for developersDrupalDay
 
Docker for developers
Docker for developersDocker for developers
Docker for developerssparkfabrik
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersYajushi Srivastava
 
Docker Fundamentals
Docker FundamentalsDocker Fundamentals
Docker FundamentalsAnshul Patel
 

Similar to Docker up and Running For Web Developers (20)

Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
DOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDESDOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDES
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with Docker
 
Docker on Power Systems
Docker on Power SystemsDocker on Power Systems
Docker on Power Systems
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
 
Introduction to docker and docker compose
Introduction to docker and docker composeIntroduction to docker and docker compose
Introduction to docker and docker compose
 
Docker Container Introduction
Docker Container IntroductionDocker Container Introduction
Docker Container Introduction
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container worldDocker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container world
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker Fundamentals
Docker FundamentalsDocker Fundamentals
Docker Fundamentals
 

More from BADR

Vue.js
Vue.jsVue.js
Vue.jsBADR
 
There and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming LanguagesThere and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming LanguagesBADR
 
Take Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven DevelopmentTake Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven DevelopmentBADR
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility PrincipleBADR
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL DatabasesBADR
 
Getting some Git
Getting some GitGetting some Git
Getting some GitBADR
 
ReactiveX
ReactiveXReactiveX
ReactiveXBADR
 
Algorithms - A Sneak Peek
Algorithms - A Sneak PeekAlgorithms - A Sneak Peek
Algorithms - A Sneak PeekBADR
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to ZBADR
 
Apache Hadoop - Big Data Engineering
Apache Hadoop - Big Data EngineeringApache Hadoop - Big Data Engineering
Apache Hadoop - Big Data EngineeringBADR
 
MySQL Indexing
MySQL IndexingMySQL Indexing
MySQL IndexingBADR
 
Duckville - The Strategy Design Pattern
Duckville - The Strategy Design PatternDuckville - The Strategy Design Pattern
Duckville - The Strategy Design PatternBADR
 
The Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design PatternThe Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design PatternBADR
 

More from BADR (13)

Vue.js
Vue.jsVue.js
Vue.js
 
There and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming LanguagesThere and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming Languages
 
Take Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven DevelopmentTake Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven Development
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
ReactiveX
ReactiveXReactiveX
ReactiveX
 
Algorithms - A Sneak Peek
Algorithms - A Sneak PeekAlgorithms - A Sneak Peek
Algorithms - A Sneak Peek
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
 
Apache Hadoop - Big Data Engineering
Apache Hadoop - Big Data EngineeringApache Hadoop - Big Data Engineering
Apache Hadoop - Big Data Engineering
 
MySQL Indexing
MySQL IndexingMySQL Indexing
MySQL Indexing
 
Duckville - The Strategy Design Pattern
Duckville - The Strategy Design PatternDuckville - The Strategy Design Pattern
Duckville - The Strategy Design Pattern
 
The Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design PatternThe Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design Pattern
 

Recently uploaded

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 

Recently uploaded (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 

Docker up and Running For Web Developers

  • 1.
  • 2. Docker Up and Running for Web Developers Amr Fawzy Mohammed
  • 3. Outline ● What is Docker ? ● Docker Overview ● Why Docker ? ● What is the Docker platform ? ● Union file systems ● What happens when you run a container ? ● Install Docker ● Managing Images and Containers ● Docker Networking ● Get source code into a Container ● Volumes ● Communication between Containers
  • 4. ● First we need to know what Containers actually are or what they bring to the table, in order to do this we need to briefly review the history of an application's runtime environment. What is Docker ?
  • 5. ● In the beginning we used to build applications directly on physical servers in 1:1 ratio. Application's Runtime Environment
  • 6. ● Disadvantages of this technique: ○ Every application requires a ton of infrastructure. ○ It takes a lot of time to deploy or scale an app. ○ Financially, that was a highly expensive. ○ It causes massive waste of resources. ■ Most of the time these servers run at a tiny fraction of their capabilities. Application's Runtime Environment cont.
  • 7. ● This solution was not meant to be last for a long time. ● Virtualization takes place. Application's Runtime Environment cont.
  • 8. ● Virtualization technology enables to build multiple virtual machines on top of a physical machine which means running multiple applications on top of a single physical server. Application's Runtime Environment cont.
  • 10. ● Each virtual machine has it's own OS which is considered a huge overhead and a massive waste of the host physical machine's resources. Application's Runtime Environment cont.
  • 11. ● The efficient solution was using Containers. Application's Runtime Environment cont.
  • 12. ● Containers are way more lightweight than Virtual machines (no Guest OS). ● Each Container consumes less CPU,RAM,Disk space than a VM, But still provides a secure isolated runtime environment for the application. Application's Runtime Environment cont.
  • 14. ● Technologies that allow you to package and isolate applications from the rest of the system. ● Containers make it easy to Deploy Applications without massive headaches, rewriting, and break-fixing. What are containers ?
  • 15. ● Chroot system call ○ Seeds for today’s containers were planted in 1979 with the addition of the chroot system call to Version 7 Unix. ● FreeBSD jail ○ In 2000, FreeBSD 4.0 was released with a new command called jail which expanded chroot’s capabilities. A brief history of containers
  • 16. ● Solaris Zones ○ In 2004, Sun released an early build of Solaris 10, which included Solaris Containers, and later evolved into Solaris Zones. ● HP-UX Containers ○ In 2007, HP released Secure Resource Partitions for HP-UX later renamed to HP-UX Containers. A brief history of containers cont.
  • 17. ● Linux Containers (LXC) ○ In 2008, Linux Containers (LXC) were released in version 2.6.24 of the Linux kernel. ● Docker ○ In 2013, the phenomenal growth of Linux Containers starts to grow with the inclusion of user namespaces in version 3.8 of the Linux Kernel and the release of Docker one month later. A brief history of containers cont.
  • 18. ● Docker is a platform for Developers and System Admins to develop, ship, and run applications. ● Docker provides the ability to package and run an application in a loosely isolated secured environment called a container. Docker Overview
  • 19. ● Faster delivery of your applications. ● Faster deployment makes for easier management. ○ Docker speeds up the work flow, so it gets easier to make lots of small changes instead of huge updates. ○ Smaller changes mean reduced risk and more uptime. Why Docker ?
  • 20. ● Docker helps developers to care about their applications inside containers while sysadmins work on running the container in your deployment. ● “This separation of duties streamlines and simplifies the management and deployment of code” Why Docker ? Cont.
  • 21. ● Deploy and scale more easily. ● Docker containers run (almost) everywhere. ● Ensure consistency between environments. Why Docker ? Cont.
  • 22. ● We can run more containers on a given hardware combination than if you were using virtual machines. Why Docker ? Cont.
  • 23. ● Eliminate applications conflicts. ● Less OS maintenance (only the host OS). ● Ultimate portability between multiple environment. ● Setup development environment very quickly. ● Ship software faster. ● Fast deployment. ● Allows very easy scalability. ● Opens massive opportunities for automated testing. ● Moves control of the environment to the development team. Summarizing Docker Benefits
  • 24. ● Docker provides a platform to manage the lifecycle of your containers: ○ Encapsulate your applications into Docker containers. ○ Distribute and ship those containers to your teams for further development and testing. ○ Deploy those applications to your production environment. What is the Docker platform ?
  • 25. ● Docker Engine ○ lightweight and powerful open source container virtualization technology combined with a workflow for building and containerizing applications. ● Docker Registries Docker Platform Components
  • 27. ● A client-server application with these major components: ○ Server (docker daemon) ○ A REST API ○ Client (CLI) Docker Engine
  • 28. ● The Docker daemon runs on a host machine. ● The user uses the Docker client to interact with the daemon. ● The daemon creates and manages Docker objects, such as images, containers, networks, and data volumes. Docker Daemon
  • 29. ● In the form of the docker binary. ● It accepts commands from the user and communicates with the Docker daemon. ● One client can communicate with multiple unrelated daemons. Docker Client
  • 30. ● Union file systems allow files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system. ● Docker uses union file systems to combine these layers into a single image. Union file systems
  • 31. Union file systems cont. ● These layers are one of the reasons Docker is so lightweight. ○ When you change a Docker image, a new layer is built and replaces only the layer it updates. ○ To distribute the update, you only need to transfer the updated layer. ● Layering speeds up distribution of Docker images.
  • 32. ● A docker image is a read-only template. ● Docker images are the basis of the Docker containers. ● Docker images are the build component of Docker. ● You can build images from scratch or download and use images created by others. Docker images
  • 33. ● Dockerfile is a text document that contains all the commands and instructions that Docker can use to automatically build images. ● Every image starts from a base image such as ubuntu, fedora or an image of your own such as Apache, Nginx, Ruby, etc. Dockerfile
  • 34. Dockerfile cont. ● Each instruction in the Dockerfile creates a new layer in the image. ● Each image consists of a series of layers. ● Creating Image from Dockerfile ○ sudo docker build -t $image_name .
  • 35. ● FROM : Specify the base image ● MAINTAINER : Specify the image maintainer ● RUN : Run a command ● ADD : Add a file or directory ● EXPOSE : expose ports to be accessed ● ENV : Create an environment variable ● CMD : What process to run when launching a container from this image. Some Dockerfile instructions
  • 36. ● A Docker container is a runnable instance of a Docker image. ● You can run, start, stop, move, or delete a container using Docker CLI commands. ● Docker containers are the run component of Docker. Docker containers
  • 38. ● A docker registry is a library of images. ● A registry can be public or private. ● Can be on the same server as the Docker daemon or Docker client, or on a totally separate server. ● Docker registries are the distribution component of Docker. Docker registries
  • 39. ● $ docker run -i -t ubuntu /bin/bash ● This command tells the Docker daemon to create and start a container using the ubuntu image, run it in an interactive mode (-i),Allocate a pseudo-TTY and to run the /bin/bash command. ● So, what actually the Engine does behind the scene ?! What happens when you run a container ?
  • 40. ● Pulls the ubuntu image. ● Creates a new container. ● Allocates a filesystem and mounts a read-write layer. ● Allocates a network / bridge interface. ● Sets up an IP address. ● Executes the /bin/bash executable. ● Captures and provides application output. ○ (due to interactive mode) What happens when you run a container? Cont.
  • 41. ● Docker Engine is supported on Linux, Cloud, Windows, and macOS. ● For Linux use the script on this link : − https://get.docker.com/ ● For Windows or Mac Docker can be installed using Docker Toolbox Install Docker
  • 42. ● Consists of : ○ Docker Client ○ Docker Machine ○ Docker kitematic ○ Docker Compose Docker toolbox
  • 43. ● Docker machine is a tool that can be used to ○ Create Docker hosts on your Mac or Windows box, on your company network, in your data center, or on cloud providers. ○ Manage this host (start,stop,restart,..etc). ○ Upgrade the Docker client and daemon. ○ Configure a Docker client to talk to your host. Docker Machine
  • 44. ● docker-machine ls ● docker-machine start vm-name ● docker-machine stop vm-name ● docker-machine env vm-name ● docker-machine ip vm-name Docker Machine cont.
  • 45. ● sudo docker search $image_name ○ Search for an image on Docker hub repository. ● sudo docker pull $image_name ○ Pull the required image from docker hub repository. ○ Update the installed images if there is any new updates. ● sudo docker images ○ List all images on the system. ● sudo docker rmi $image_name ○ Remove an image. Managing Images and Containers
  • 46. ● sudo docker run --name $cont_name -d $image_name ○ Spin up a container from an image and make it run in the background. ● sudo docker ps ○ List the currently running containers. ● sudo docker ps -a ○ List all the containers whether they are running or not. Managing Images and Containers cont.
  • 47. ● sudo docker rm $container_name ○ Remove a stopped container. ● sudo docker rm -f $container_name ○ Force remove a container. ● sudo docker stop $container_name ○ Stop a running container. ● sudo docker inspect $container_name OR $image_name ○ This displays all the information available in Docker for a given container or image. Managing Images and Containers cont.
  • 48. ● sudo docker exec -it $container_name <command> ○ Attach to the the running container. ○ Modify this running container. ● sudo docker commit $container_name $image_name ○ Commit the modified container into image. Creating Image from a modified container
  • 49. ● When Docker creates a container, it creates two virtual interfaces, one of which sits on the server-side and is attached to the docker0 bridge, and one that is exposed into the container’s namespace. Docker Networking
  • 50. ● sudo docker run -d -p 8080 $image_name ○ Port mapping. ○ Publish port 8080 from inside the container to the docker Host on a random port (say 1234), So that the app running on port 8080 inside the container will be accessed through the host IP on that random port. ● sudo docker run -d -p 3000:8080 $image_name ○ Port redirection. ○ Publish port 8080 from inside the container to the docker Host on port 3000. Docker Networking cont.
  • 51. Docker Networking cont. ● sudo docker run -d --net=host $image_name ○ Host Networking. ○ Share the host IP address. ● sudo docker inspect $container_name | grep IPAddress ○ Get the IP Address of the running container.
  • 53. ● Create a container volume that points to the source code. ● Add your source code into a custom image that is used to create a container. Get source code into a Container
  • 54. ● A special type of directories in a container typically referred to as a “data volume”. ● Can be shared and reused among containers. Volumes
  • 55. Volumes cont. ● sudo docker create --name mydataContainer -v /usr/share/nginx/html ubuntu:latest ● sudo docker run --name mywebserverContainer --volumes-from mydataContainer -d nginx ● Sudo docker run --name myApp -p 8080:3000 -v /local/fs/path/:/container/fs/path -w “/var/www” -d node npm start
  • 56. Communication between Containers ● Linking containers with names by using --link option ○ sudo docker run --name myMongodbContainer -d mongo ○ sudo docker run --name railsAppContainer -p 3005:3000 --link myMongodbContainer:mongodbContainer -d afawzy/integrationImage
  • 57. Communication between Containers ● Create a custom bridge network and add containers into it. ○ sudo docker network create --driver bridge isolated_network ○ sudo docker run --name mongodbContainer --net=isolated_network -d mongo ○ sudo docker run --name railsAppContainer -p3005:3000 --net=isolated_network -d afawzy/integrationImage
  • 58. References ● https://docs.docker.com/ ● man docker ● Docker: Up & Running: Shipping Reliable Containers in Production ● Docker: Intro - CBT Nuggets ● Docker for Web Developers - Pluralsight ● Docker Deep Dive - Pluralsight ● Learn how to deploy Docker applications to production - udemy