4. Linux Containers
● Use Linux kernel isolation features to give a VM
like environment.
● Docker may be a two years old project, but
Linux containers are older than that.
● Docker, Lxc, Rkt, lmctfy
6. Introducing Docker
● Sand boxing of process/Application.
● Lightweight container virtualization platform.
● It is an application packaging and delivery
technology.
8. Why Docker?
● I already have virtualization, do I need Docker?
– Yes, because it an awesome way of shipping
application.
– It reduces the time , from developing an application
to putting it in to production.
– Each Docker container can be an independent
entity.
– Different run time for different containers.
9. Docker Vs Virtualization
● Lighter than Virtual machines.
● Take less time to start
● We can run a ton of processes on a reasonably
sized host
● Deploying and scaling relatively easy.
● “Dockerized” apps are completely portable.
10. Technologies Behind Docker
● Control groups
– It is a Linux kernel feature.
– allocate resources i.e. CPU time, system memory,
network bandwidth, or combinations of these
resources to a process/ processes.
● Union file systems
– layered file system, so you can have a read only part,
and a write part, and merge those together.
– E.g. : AUFS, btrfs, vfs, and DeviceMapper
11. Technologies Behind Docker
● Namespaces
– It helps to create isolated workspace.
– When you run a container, Docker creates a set of
namespaces for that container.
● Selinux
– SELinux provides secure separation of containers
by applying SELinux policy and labels
● There are some more ....
12.
13. Docker Components
● Image
– It is a template which is used to launch containers.
● Container
– It is like a directory. A Docker container holds
everything that is needed for an application to run.
14. Docker Components
● Registry
– It stores and serves up the actual image assets,
and it delegates authentication to the index.
● Repository
– A registry holds a collection of named repositories,
which themselves are a collection of images
tracked by GUIDs.
15. Demo
● Install docker RPM
– $yum install docker-io
● Start the docker demon
– $systemctl start docker
● Enable docker service. So that, it automatically start
after reboot
– $systemctl enable docker
● For details about installation, check :
http://docs.docker.com/installation/fedora/
16. ● #Search an image
– $docker search name
● #Download an image
– $docker pull fedora
● #List images
– $docker images
● #Run image.
– $docker run -t -i fedora /bin/bash
17. ● #Stop a container
– $docker stop <ID/Name>
● #kill a container
– $docker kill container_name
● #Run a script inside a container
● #Save the change
– $docker diff ID/name
– $docker commit -m lalatendu -a testscript 7f28a2303254
centos7:test_container
● #Remove the image
– $docker rmi image_name
● #Remove the container
– $docker rm container_name
18. This slide is available at :
http://www.slideshare.net/then4way/docker-
quick-start