SlideShare une entreprise Scribd logo
1  sur  21
Docker: The Linux container
Name: BalajiRajan
Date: 29-Sep-2013
Event:http://www.meetup.com/devops-bangalore
What is docker?
Docker is a tool created by the folks at dotCloud to make
using LinuX Containers (LXC) easier to use.
Linux Containers are basically light weight Virtual Machines
(VM). A linux container runs Unix processes with strong
guarantees of isolation across servers.
Your software runs repeatably everywhere because its
Container includes all of its dependencies.
LXC
 Lxc is an operating system-level virtualization method for
running multiple isolated Linux systems (containers) on a
single control host.
 Basicaly, LXC provides a way to run mini operating
systems in your host operating system.
What about VM?
● Any virtualization technologies such as KVM, Hypervisor
and Xen..etc, which started by booting separate virtual
systems on emulated hardware, and then new vm runs
as a full fledged OS and uses isolated process spaces.
● But Docker runs with Host Operating system as its
share the host process spaces.
Docker vs VMs
Docker Vs VMs
 Size:
VMs are very large which makes them
impractical to store and transfer.
VM: You have a container image that is 1GB in size. If
you wanted to use a Full VM, you would need to have
1GB times x number of VMs you want.
Docker: With LXC you can share the bulk of the 1GB. It
means that If you have 1000 containers you still might
only have a little over 1GB of space for the containers
OS, assuming they are all running the same OS image.
Docker Vs VMs
 Resource Utilization: (CPU & RAM)
VM: A full virtualized system gets it's own set of
resources allocated to it, and does minimal sharing. You
get more isolation, but it is much heavier and requires
more resources.
Docker: With LXC you get less isolation, but they are
more lightweight and require less resources.
Docker Vs VMs
 Performance:
VM: A full virtualized system usually takes minutes to
start.
Docker: LXC containers take seconds, and most times
less then a second.
Docker's Advantage
 Throwable Sandboxes: Create a container in a minute
to test your stuffs and tear it down.
 Fine Application Delivery: Containers allow you to
package just about any application. You could add the
dependencies of the application in the container itself.
Ex: mysql service.
 Reusability: Docker makes containers reusbale.
 Uniformity: Development and production Environments.
Installing Docker
* Docker is still under heavy development! Don’t
recommend using it in production yet.
* Right now, the officially supported distributions are:
* Ubuntu Precise 12.04 (LTS) (64-bit)
* Ubuntu Raring 13.04 (64 bit)
Installing Docker
Requirement:
* Kernel version: greater then 3.8 and Cgroups and
namespaces must be enabled.
* AUFS: AUFS is included in the kernels built by the
Debian and Ubuntu distributions.
* LXC:
Installation method
* Source
* compiled binary
* package manager
Installing Docker
# Add the Docker repository to your apt sources list.
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main >
/etc/apt/sources.list.d/docker.list"
# Update your sources
sudo apt-get update
# Install, lxc-docker
sudo apt-get install lxc-docker
# download the base 'ubuntu' container and run bash inside it
#while setting up an interactive shell
sudo docker run -i -t ubuntu /bin/bash
Installing Docker
# docker version
Client version: 0.4.8
Server version: 0.4.8
# docker info
Containers: 0
Images: 0
WARNING: No memory limit support
WARNING: No swap limit support
Terminalogy
* Image
An image is a read only layer used to build a container. They
do not change.
* Container
Is basically a self contained runtime environment that is
built using one or more images. You can commit your
changes to a container and create an image.
* Docker index / registry
These are public or private servers where people can upload
their repositories so they can easily share what they made.
Creating container
balaji@devops$ docker run -i -t ubuntu:12.04
/bin/bash
$ cat /etc/issue
Ubuntu 12.04 n
$
Lets see what docker is doing here.
1. Downloaded the image from docker repo.
2. Generated a new LXC container.
3. Created a new file system.
4. Mounted a read/write layer.
5. Allocated network interface.
6. Setup IP.
7. Setup NATing.
8 Executed the bash shell in the container.
*****All in under a very few minutes *********
Work with CLI:
* List Images:
$ docker images
REPOSITORY TAG ID CREATED SIZE
base latest b750fe79269d 3 months ago 24.65 kB
(virtual 180.1 MB)
base ubuntu-12.10 b750fe79269d 3 months ago 24.65 kB
(virtual 180.1 MB)
base ubuntu-quantal b750fe79269d 3 months ago 24.65 kB
(virtual 180.1 MB)
base ubuntu-quantl b750fe79269d 3 months ago 24.65 kB
(virtual 180.1 MB)
*List Containers:
$ docker ps -a
ID IMAGE COMMAND CREATED STATUS
PORTS
861361e27501 base:latest /bin/echo hello world 1 minutes ago Exit 0
Docker Index/registry
The Docker Registry is server that stores all of the
images and repositories. The Index just has the metadata
about the images, repositories and the user accounts, but
all of the images and repositories are stored in the
Docker Registry.
$ docker login
Username (): myusername
Password:
Email ():
myusername@example.com
Login Succeeded
Work with CLI:
Important commands:
* docker run base /bin/echo hello world
* docker commit <id>
* docker attach <id>
* docker pull / push <id>
* docker inspect <id>
* docker diff <id>
* docker stop/start <id>
* docker rmi `docker images -a -q` - remove images
* docker rm `docker ps -a -q` - remove container
More Projects are coming on the way...
● http://blog.docker.io/2013/07/docker-projects-from-the-docker-co
Important Projects:
* Building Docker on Openstack with Vagrant
* DockerUI – Web interface
* Openstack-Docker
* chef-docker - Installs/Configures Docker
* Puppet module for installing Docker
* dockermix – A command line tool to build and manage
multi-container docker environments
●
References:
1. docker.io
2. https://github.com/dotcloud/docker
3. http://kencochrane.net/blog/

Contenu connexe

Tendances

OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQ
dotCloud
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
John Willis
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9
Jérôme Petazzoni
 

Tendances (20)

Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
 
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16 What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
 
Basic docker for developer
Basic docker for developerBasic docker for developer
Basic docker for developer
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQ
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Introduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and DockerIntroduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9
 

En vedette

Why Docker
Why DockerWhy Docker
Why Docker
dotCloud
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
OpenStack Korea Community
 

En vedette (20)

Why Docker
Why DockerWhy Docker
Why Docker
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
KVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackKVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStack
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?
 
Online Meetup: What's new in docker 1.13.0
Online Meetup: What's new in docker 1.13.0 Online Meetup: What's new in docker 1.13.0
Online Meetup: What's new in docker 1.13.0
 
Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)
 
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
 
Lxd the proper way of runing containers
Lxd   the proper way of runing containersLxd   the proper way of runing containers
Lxd the proper way of runing containers
 
Container as a Service with Docker
Container as a Service with DockerContainer as a Service with Docker
Container as a Service with Docker
 
Infinit: Modern Storage Platform for Container Environments
Infinit: Modern Storage Platform for Container EnvironmentsInfinit: Modern Storage Platform for Container Environments
Infinit: Modern Storage Platform for Container Environments
 
Containerd - core container runtime component
Containerd - core container runtime component Containerd - core container runtime component
Containerd - core container runtime component
 
containerd and CRI
containerd and CRIcontainerd and CRI
containerd and CRI
 
OpenStack Tutorial
OpenStack TutorialOpenStack Tutorial
OpenStack Tutorial
 
Docker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EEDocker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EE
 
Openvz booth
Openvz boothOpenvz booth
Openvz booth
 
Docker - Build, Ship and Run Any App, Anywhere Hollywood edition
Docker - Build, Ship and Run Any App, Anywhere Hollywood editionDocker - Build, Ship and Run Any App, Anywhere Hollywood edition
Docker - Build, Ship and Run Any App, Anywhere Hollywood edition
 
Dchug m7-30 apr2013
Dchug m7-30 apr2013Dchug m7-30 apr2013
Dchug m7-30 apr2013
 

Similaire à Docker - The Linux Container

Similaire à Docker - The Linux Container (20)

Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
The Docker Ecosystem
The Docker EcosystemThe Docker Ecosystem
The Docker Ecosystem
 
Docker intro
Docker introDocker intro
Docker intro
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
Docker navjot kaur
Docker navjot kaurDocker navjot kaur
Docker navjot kaur
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
 
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
 
Docker
DockerDocker
Docker
 
Docker
DockerDocker
Docker
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Docker + Jelastic - planeetta.fi
Docker + Jelastic - planeetta.fiDocker + Jelastic - planeetta.fi
Docker + Jelastic - planeetta.fi
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Docker Oxford launch - Introduction to Docker
Docker Oxford launch - Introduction to DockerDocker Oxford launch - Introduction to Docker
Docker Oxford launch - Introduction to Docker
 
Docker
DockerDocker
Docker
 
Docker slides
Docker slidesDocker slides
Docker slides
 
Docker
DockerDocker
Docker
 
Docker In Brief
Docker In BriefDocker In Brief
Docker In Brief
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Docker - The Linux Container

  • 1. Docker: The Linux container Name: BalajiRajan Date: 29-Sep-2013 Event:http://www.meetup.com/devops-bangalore
  • 2. What is docker? Docker is a tool created by the folks at dotCloud to make using LinuX Containers (LXC) easier to use. Linux Containers are basically light weight Virtual Machines (VM). A linux container runs Unix processes with strong guarantees of isolation across servers. Your software runs repeatably everywhere because its Container includes all of its dependencies.
  • 3. LXC  Lxc is an operating system-level virtualization method for running multiple isolated Linux systems (containers) on a single control host.  Basicaly, LXC provides a way to run mini operating systems in your host operating system.
  • 4. What about VM? ● Any virtualization technologies such as KVM, Hypervisor and Xen..etc, which started by booting separate virtual systems on emulated hardware, and then new vm runs as a full fledged OS and uses isolated process spaces. ● But Docker runs with Host Operating system as its share the host process spaces.
  • 6. Docker Vs VMs  Size: VMs are very large which makes them impractical to store and transfer. VM: You have a container image that is 1GB in size. If you wanted to use a Full VM, you would need to have 1GB times x number of VMs you want. Docker: With LXC you can share the bulk of the 1GB. It means that If you have 1000 containers you still might only have a little over 1GB of space for the containers OS, assuming they are all running the same OS image.
  • 7. Docker Vs VMs  Resource Utilization: (CPU & RAM) VM: A full virtualized system gets it's own set of resources allocated to it, and does minimal sharing. You get more isolation, but it is much heavier and requires more resources. Docker: With LXC you get less isolation, but they are more lightweight and require less resources.
  • 8. Docker Vs VMs  Performance: VM: A full virtualized system usually takes minutes to start. Docker: LXC containers take seconds, and most times less then a second.
  • 9. Docker's Advantage  Throwable Sandboxes: Create a container in a minute to test your stuffs and tear it down.  Fine Application Delivery: Containers allow you to package just about any application. You could add the dependencies of the application in the container itself. Ex: mysql service.  Reusability: Docker makes containers reusbale.  Uniformity: Development and production Environments.
  • 10. Installing Docker * Docker is still under heavy development! Don’t recommend using it in production yet. * Right now, the officially supported distributions are: * Ubuntu Precise 12.04 (LTS) (64-bit) * Ubuntu Raring 13.04 (64 bit)
  • 11. Installing Docker Requirement: * Kernel version: greater then 3.8 and Cgroups and namespaces must be enabled. * AUFS: AUFS is included in the kernels built by the Debian and Ubuntu distributions. * LXC: Installation method * Source * compiled binary * package manager
  • 12. Installing Docker # Add the Docker repository to your apt sources list. sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" # Update your sources sudo apt-get update # Install, lxc-docker sudo apt-get install lxc-docker # download the base 'ubuntu' container and run bash inside it #while setting up an interactive shell sudo docker run -i -t ubuntu /bin/bash
  • 13. Installing Docker # docker version Client version: 0.4.8 Server version: 0.4.8 # docker info Containers: 0 Images: 0 WARNING: No memory limit support WARNING: No swap limit support
  • 14. Terminalogy * Image An image is a read only layer used to build a container. They do not change. * Container Is basically a self contained runtime environment that is built using one or more images. You can commit your changes to a container and create an image. * Docker index / registry These are public or private servers where people can upload their repositories so they can easily share what they made.
  • 15. Creating container balaji@devops$ docker run -i -t ubuntu:12.04 /bin/bash $ cat /etc/issue Ubuntu 12.04 n $
  • 16. Lets see what docker is doing here. 1. Downloaded the image from docker repo. 2. Generated a new LXC container. 3. Created a new file system. 4. Mounted a read/write layer. 5. Allocated network interface. 6. Setup IP. 7. Setup NATing. 8 Executed the bash shell in the container. *****All in under a very few minutes *********
  • 17. Work with CLI: * List Images: $ docker images REPOSITORY TAG ID CREATED SIZE base latest b750fe79269d 3 months ago 24.65 kB (virtual 180.1 MB) base ubuntu-12.10 b750fe79269d 3 months ago 24.65 kB (virtual 180.1 MB) base ubuntu-quantal b750fe79269d 3 months ago 24.65 kB (virtual 180.1 MB) base ubuntu-quantl b750fe79269d 3 months ago 24.65 kB (virtual 180.1 MB) *List Containers: $ docker ps -a ID IMAGE COMMAND CREATED STATUS PORTS 861361e27501 base:latest /bin/echo hello world 1 minutes ago Exit 0
  • 18. Docker Index/registry The Docker Registry is server that stores all of the images and repositories. The Index just has the metadata about the images, repositories and the user accounts, but all of the images and repositories are stored in the Docker Registry. $ docker login Username (): myusername Password: Email (): myusername@example.com Login Succeeded
  • 19. Work with CLI: Important commands: * docker run base /bin/echo hello world * docker commit <id> * docker attach <id> * docker pull / push <id> * docker inspect <id> * docker diff <id> * docker stop/start <id> * docker rmi `docker images -a -q` - remove images * docker rm `docker ps -a -q` - remove container
  • 20. More Projects are coming on the way... ● http://blog.docker.io/2013/07/docker-projects-from-the-docker-co Important Projects: * Building Docker on Openstack with Vagrant * DockerUI – Web interface * Openstack-Docker * chef-docker - Installs/Configures Docker * Puppet module for installing Docker * dockermix – A command line tool to build and manage multi-container docker environments ●