Does Docker replace VM?
What does it do?
Is Docker useful for
developers or only for
What problems does it
A virtual machine (VM) is an operating system or
application environment that is installed on software,
which imitates dedicated hardware.
The end user has the same experience on a virtual
machine as they would have on dedicated hardware.
Specialized software, called a hypervisor or Virtual
Machine Monitor, emulates the PC client or
server's CPU, memory, hard disk, network and other
hardware resources completely, enabling virtual
machines to share the resources.
Virtualization limits costs by reducing the need for
physical hardware systems.
Docker is a tool designed to make it easier to create,
deploy, and run applications by using containers.
Docker containers wrap a piece of software in a
complete filesystem that contains everything needed
to run: code, runtime, system tools, system libraries –
anything that can be installed on a server.
Containers running on a single machine share the
same operating system kernel.
It gives a significant performance boost and reduces
the size of the application.
Docker gives you the ability to snapshot the OS into
a shared image, and makes it easy to deploy on other
docker hosts. Locally, dev, qa, prod, etc.: all the same
Virtual Machines Docker
Each VM has its own OS Shares the kernel with other
Virtual machine images are
Containers have much smaller
A virtual machine could take up
several minutes to create and
A container can be created and
launched just in a few seconds
Benefits: security and isolation. Benefits: easier and more
lightweight to deploy and faster to
In IaaS use cases, machine
virtualization is an ideal fit.
Containers are best suited for
packaging/shipping portable and
Clearly—for DevOps and CI/CD initiatives—application portability and
consistency are crucial needs that Docker fulfills quite nicely.
Simply put, containers provide OS-level process isolation whereas virtual
machines offer isolation at the hardware abstraction layer.
Again, the two technologies can be used in conjunction with each other for added
benefits—for example, Docker containers can be created inside VMs to make a
For now, Docker doesn’t replace VM.
Use Docker as version control system for your entire app's operating system
Use Docker when you want to distribute/collaborate on your app's operating
system with a team
Use Docker to run your code on your laptop in the same environment as you have
on your server (try the building tool)
Use Docker whenever your app needs to go through multiple phases of
Use Docker with your Chef Cookbooks and Puppet Manifests
The Amazon AMI Marketplace is the closest thing to the Docker Index that you
will find. With AMIs, you can only run them on Amazon. With Docker, you can run
the images on any Linux server that runs Docker.
The Warden project is a LXC manager written for Cloud Foundry without any of
the social features of Docker like sharing images with other people on the Docker
The collaboration features (docker push and docker pull) are one of the most
disruptive parts of Docker.
With Docker pull/push the developers and ops guys, have first time been able to
easily collaborate quickly on building infrastructure together.
The developers can focus on building great applications and the ops guys can focus
on building perfect service containers.
The app guys can share app containers with ops guys and the ops guys can share
MySQL and PosgreSQL and Redis servers with app guys.
It works on my
not on yours
I have been
helping the [new
hire] setup her
I can’t try it
I have to work
fix this issue.
Create a local
Distribute it to
Pull it in local
Work on “just
as you switch
Container - a runtime instance of a Docker image.
Image - an ordered collection of root filesystem changes and execution parameters
for use within a running container.
Layer - a “slice” of the container filesystem; one layer is created by each Dockerfile
Dockerfile - a text script that contains the commands you execute to build a
Registry - a repository of images. It can be public or private. This is a web service.
Docker can build images automatically by reading the instructions from a
A Dockerfile is a text document that contains all the commands a user could call
on the command line to assemble an image.
Using docker build users can create an automated build that executes several
command-line instructions in succession.
RUN apt-get update
RUN apt-get install -y nginx
Select the base image
Set the author
Add new layer on the image
specify the default app
that you want to run
Build An Image
$ docker build -t gvacca/nginx .
Store image in a registry
(public, e.g. Dockerhub, or
$ docker push gvacca/nginx
Pull image on the target host
$ docker pull gvacca/nginx
Run container on the target
$ docker run -it gvacca/nginx
Docker Machine: Provides a CLI to quickly provision a Docker Host. Deploys
locally or on a Cloud Provider AWS, Azure, GCE, DO, Rackspace, VMWare, etc…
Docker Registry: Store and distribute your docker container images. Docker Hub
makes it easy: hub.docker.com.
Docker Swarm: Exposes several Docker Engines as a single virtual Engine. Serves
the standard Docker API. Swarm is production ready Docker CLI.
Docker Hub is a cloud hosted service from Docker that provides registry
capabilities for public and private content.
In Docker Hub, you usually put Docker Images that can be used/searched by other
Docker Hub lets developers store and distribute their images with ease. You can
search some ready to go building blocks for your infrastructure.
Quickly create an organization, add users or create groups of users to collaborate
with your repositories.
Browse and search any public Docker image repositories for popular content.
Share your images with the community or host in private repositories for secure
collaboration with your team