0% found this document useful (0 votes)
215 views

Docker

Docker is an open platform for developing, shipping, and running applications. It allows separating applications from infrastructure and treating infrastructure like a managed application. Docker provides isolation and security through containers which run applications efficiently without a hypervisor. Docker images are templates used to create and deploy containers to production. The Docker client communicates with the Docker daemon which builds, runs, and distributes containers.

Uploaded by

Biplab Parida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
215 views

Docker

Docker is an open platform for developing, shipping, and running applications. It allows separating applications from infrastructure and treating infrastructure like a managed application. Docker provides isolation and security through containers which run applications efficiently without a hypervisor. Docker images are templates used to create and deploy containers to production. The Docker client communicates with the Docker daemon which builds, runs, and distributes containers.

Uploaded by

Biplab Parida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Docker

Docker

 Docker is an open platform for developing, shipping,


and running applications.
 With Docker you can separate your applications
from your infrastructure and treat your
infrastructure like a managed application
 At its core, Docker provides a way to run almost any
application securely isolated in a container
Docker

 The isolation and security allow you to run many


containers simultaneously on your host.
 The lightweight nature of containers, which run
without the extra load of a hypervisor, means you
can get more out of your hardware.
Docker: Benefits

 Getting your applications (and supporting


components) into Docker containers
 Distributing and shipping those containers to your
teams for further development and testing
 Deploying those applications to your production
environment, whether it be in a local data center or
the Cloud
Docker Components

 Docker: the open source container virtualization


platform.
 Docker Hub: Software-as-a-Service platform for
sharing and managing Docker containers
Docker Architecture

 Docker uses a client-server architecture.


 The Docker client talks to the Docker daemon, which
does the heavy lifting of building, running, and
distributing your Docker containers.
 Both the Docker client and the daemon can run on
the same system, or you can connect a Docker client
to a remote Docker daemon.
 The Docker client and daemon communicate via
sockets or through a RESTful API.
Docker Architecture
Docker Internals

 Docker images.
 Docker registries.
 Docker containers.
Docker Images

 A Docker image is a read-only template. For


example, an image could contain an Ubuntu
operating system with Apache and your web
application installed.
 Images are used to create Docker containers.
 Docker provides a simple way to build new images or
update existing images, or you can download Docker
images that other people have already created.
 Docker images are the build component of Docker.
Docker Registries

 Docker registries hold images. These are public or


private stores from which you upload or download
images.
 The public Docker registry is called Docker Hub. It
provides a huge collection of existing images for your
use.
 These can be images you create yourself or you can
use images that others have previously created.
 Docker registries are the distribution component
of Docker.
Docker Container

 Docker containers are similar to a directory.


 A Docker container holds everything that is needed
for an application to run.
 Each container is created from a Docker image.
 Docker containers can be run, started, stopped,
moved, and deleted.
 Each container is an isolated and secure application
platform.
 Docker containers are the run component of
Docker.
How does Docker work

 You can build Docker images that hold your


applications.
 You can create Docker containers from those Docker
images to run your applications.
 You can share those Docker images via Docker Hub
or your own registry.
How does Docker work

 Docker images are read-only templates from which


Docker containers are launched. Each image consists
of a series of layers. Docker makes use of union file
systems to combine these layers into a single image.
 Union file systems allow files and directories of
separate file systems, known as branches, to be
transparently overlaid, forming a single coherent file
system
How does Docker work

 One of the reasons Docker is so lightweight is


because of these layers.
 When you change a Docker image—for example,
update an application to a new version— a new layer
gets built.
 Thus, rather than replacing the whole image or
entirely rebuilding, as you may do with a virtual
machine, only that layer is added or updated.
 Now you don't need to distribute a whole new image,
just the update, making distributing Docker images
faster and simpler.
How does Docker work

 Every image starts from a base image, for example


ubuntu, a base Ubuntu image, or fedora, a base
Fedora image.
 You can also use images of your own as the basis for
a new image, for example if you have a base Apache
image you could use this as the base of all your web
application images
How does Docker work

 Once you build a Docker image you can push it to a


public registry Docker Hub or to your own registry
running behind your firewall
 A container consists of an operating system, user-
added files, and meta-data
 each container is built from an image
How does Docker work

 That image tells Docker what the container holds,


what process to run when the container is launched,
and a variety of other configuration data.
 The Docker image is read-only.
 When Docker runs a container from an image, it
adds a read-write layer on top of the image (using a
union file system as we saw earlier) in which your
application can then run
How to run a container

 $ sudo docker run -i -t ubuntu /bin/bash


 Pulls the ubuntu image: Docker checks for the
presence of the ubuntu image and, if it doesn't exist
locally on the host, then Docker downloads it from
Docker Hub. If the image already exists, then Docker
uses it for the new container.
 Creates a new container: Once Docker has the
image, it uses it to create a container.
 Allocates a filesystem and mounts a read-
write layer: The container is created in the file
system and a read-write layer is added to the image.
How to run a container

 Allocates a network / bridge interface: Creates


a network interface that allows the Docker container
to talk to the local host.
 Sets up an IP address: Finds and attaches an
available IP address from a pool.
 Executes a process that you specify: Runs your
application, and;
 Captures and provides application output:
Connects and logs standard input, outputs and
errors for you to see how your application is running.
Docker Technology

 Docker is written in Go and makes use of several


Linux kernel features
Docker Lab
Docker Lab Instructions

 Start your EC2 instance (in the IAM account)


 Connect to your instance over SSH
 Enter the command:
 sudo yum install -y docker
 sudo service docker start
 docker version
 docker search tutorial
Docker Lab

 docker pull learn/tutorial


 docker run learn/tutorial echo "hello world”
 docker run learn/tutorial apt-get install -y ping
 docker commit 698 learn/ping
 docker run learn/ping ping google.com
 docker inspect efe
 docker push learn/ping
Docker Lab

 sudo docker search ubuntu


 sudo docker pull ubuntu:latest
 sudo docker run –it ubuntu:latest /bin/bash
 <container-id>$ apt-get update

 <container-id>$ apt-get install apache2

 <container-id>$ apt-get install php5 libapache2-mod-php5


php5-mcrypt
 sudo docker commit <container-id> -t myphp
Docker Lab

 Check the public ip address in your client browser

You might also like