2. You are a employee at some XYZ company. You are in backend development
department of that company and there are other departments also like
administrator, frontend, customer service, testing, cloud, etc…
You are developing a WEB APP.
This WEB APP has many dependencies so in order to work seemly for all
departments at this project they have to define some constraints.
So that this APP run same in all the departments system!
Its kind of a hectic task!
There can be many problems!
So what's the solution for it?
4. LXC (Linux Containers) is a Linux operating system level virtualization method for
running multiple isolated Linux systems on a single host.
Linux containers, in short, contain applications in a way that keep them isolated from
the host system that they run on.
Containers allow a developer to package up an application with all of the parts it
needs, such as libraries and other dependencies, and ship it all out as one package.
In a way, containers behave like a virtual machine. To the outside world, they can look
like their own complete system.
But unlike a virtual machine, rather than creating a whole virtual operating system,
containers don't need to replicate an entire operating system, only the individual
components they need in order to operate.
This gives a significant performance boost and reduces the size of the application.
They also operate much faster, as unlike traditional virtualization the process is
essentially running natively on its host, just with an additional layer of protection
6. • Docker is a container management service. The keywords
of Docker are develop, ship and run anywhere. The whole
idea of Docker is for developers to easily develop
applications, ship them into containers which can then be
• Docker containers wrap up a piece of software in a
complete file system that contains everything it needs
to run: code, runtime, system tools, system libraries –
anything you can install on a server.
• This guarantees that it will always run the same,
regardless of the environment it is running in.
7. Docker has the ability to reduce the size of development by providing a smaller
footprint of the operating system via containers.
With containers, it becomes easier for teams across different units, such as
development, QA and Operations to work seamlessly across applications.
You can deploy Docker containers anywhere, on any physical and virtual machines
and even on the cloud.
Since Docker containers are pretty lightweight, they are very easily scalable.
8. API endpoint
nginx 1.5 + modsecurity + openssl + bootstrap 2
postgresql + pgv8 + v8
hadoop + hive + thrift + OpenJDK
Ruby + Rails + sass + Unicorn
Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs +
Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client
Customer Data Center
9. Static website User DB Web frontend Queue Analytics DB
QAserver Public Cloud Contributor’s
…that can be manipulated using
standard operations and run
consistently on virtually any
An engine that enables any
payload to be encapsulated as
a lightweight, portable, self-
11. Build once, runanywhere
A clean,safe, hygienic and portable runtime environment for yourapp.
No worries about missing dependencies, packages and other pain points
during subsequent deployments.
Run each app in its own isolated container, so you can run various versions of
libraries and other dependencies for each app without worrying
12. Automate testing, integration, packaging…anything you can script
Reduce/eliminate concerns about compatibility on different platforms, either
your own or your customers.
Cheap, zero-penalty containers to deploy services? A VM without the overhead of
a VM? Instant replay and reset of image snapshots? That’s the power of Docker
13. Configure once…run anything
Make the entire lifecycle more efficient, consistent, and repeatable
Increase the quality of code produced by developers.
Eliminate inconsistencies between development, test, production, and
14. Support segregation of duties.
Significantly improves the speed and reliability of continuous deployment
and continuous integration systems.
Because the containers are so lightweight, address significant performance,
costs, deployment, and portability issues normally associated with VMs.
15. • The Developer
• Worries about
• His code
• His Libraries
• His Apps
• His Data
• All Linux
• The Administrator
• Worries about
• Remote access
• Network config
• All containers
start, stop, copy,
etc. the same way
17. Docker takes advantage of a technology called namespaces to provide the
isolated workspace we call the container.
When you run a container, Docker creates a set of namespace for that container.
Some of the namespaces that Docker Engine uses on Linux are:-
• The pid namespace: Process isolation (PID: Process ID).
• The net namespace:Managing network interfaces .
• The ipc namespace:Managing access to IPC resources (IPC: InterProcess
• The mnt namespace: Managing mount-points (MNT: Mount).
• The uts namespace: Isolating kernel and version identifiers. (UTS: Unix
18. Docker Engine on Linux also makes use of another
technology called cgroups or control groups.
A key to running applications in isolation is to have them only use the
resources you want.
This ensures containers are good multi-tenant citizens on a host.
Control groups allow Docker Engine to share available hardware resources to
containers and, if required, set up limits and constraints.
For example, limiting the memory available to a specific container.
20. Docker Engine is a client-server application with these
• A server which is a type of long-running program called a daemon process.
• A REST API which specifies interfaces that programs can use to talk to the
daemon and instruct it what to do.
• A command line interface (CLI) client.
22. •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 alreadycreated.
•Docker images are the build component of Docker.
23. •Docker can build images automatically by reading the
instructions from a DockerFile.
•A Dockerfile is a text document that contains all the
commands a user could call on the command line to assemble an
•Using docker build users can create an automated build that
executes several command-line instructions in succession.
•The docker build command builds an image from a Dockerfile
25. •Docker registries hold images.
•These are public or private stores from which you upload
or download images.
•The public Docker registry is provided with the Docker
•It serves 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
26. •The CLI makes use of the Docker REST API to control or
interact with the Docker daemon through scripting or direct
•Many other Docker applications make use of the
underlying API andCLI.
•The CLI is also used to issue commands.
28. Persisted snapshot that can be run
images: List all local images
run: Create a container from an image and execute a command in
tag: Tag an image
pull: Download image from repository
rmi: Delete a local image
This will also remove intermediate images if no longer used
29. Runnable instance of an image
ps: List all running containers
ps –a: List all containers (incl. stopped)
top: Display processes of a container
start: Start a stopped container
stop: Stop a running container
pause: Pause all processes within a container
rm: Delete a container
commit: Create an image from a container
Hinweis der Redaktion
Each virtualized application includes not only the application - which may be only 10s of MB - and the necessary binaries and libraries, but also an entire guest operating system - which may weigh 10s of GB.
The Docker Engine container comprises just the application and its dependencies. It runs as an isolated process in userspace on the host operating system, sharing the kernel with other containers. Thus, it enjoys the resource isolation and allocation benefits of VMs but is much more portable and efficient.
Docker provides base images that contain OS installations we can start from: The OS is not more than an application running on the Kernel...
docker run --rm to remove container after termination