docker quick start

20
Introduction To Docker Lalatendu Mohanty Twitter: @lalatenduM Software Engineer @Red Hat

Upload: lalatendu-mohanty

Post on 10-Aug-2015

248 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Docker quick start

Introduction To Docker

Lalatendu MohantyTwitter: @lalatenduM

Software Engineer @Red Hat

Page 2: Docker quick start

What we want?

● Scalability, maintainability, Agility, Portability.● A continuum of abstraction levels.● Improved resource utilization.

Page 3: Docker quick start

Linux Containers

Page 4: Docker quick start

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

Page 5: Docker quick start

Docker

Page 6: Docker quick start

Introducing Docker

● Sand boxing of process/Application.● Lightweight container virtualization platform.● It is an application packaging and delivery

technology.

Page 7: Docker quick start

Why Docker?

Page 8: Docker quick start

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.

Page 9: Docker quick start

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.

Page 10: Docker quick start

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

Page 11: Docker quick start

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 ....

Page 12: Docker quick start
Page 13: Docker quick start

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.

Page 14: Docker quick start

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.

Page 15: Docker quick start

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/

Page 16: Docker quick start

● #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

Page 17: Docker quick start

● #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

Page 18: Docker quick start

This slide is available at : http://www.slideshare.net/then4way/docker-quick-start

Page 19: Docker quick start

Get involved

● https://github.com/docker● https://github.com/coreos● https://github.com/projectatomic

Page 20: Docker quick start

Thank You :-)Any questions please?