Your SlideShare is downloading. ×
0
Introduction to Linux Containers & Docker
Jozi Linux User Group – Jan 2014
Introduction to Linux Containers
●

Makes use of:
–

Namespaces:
●
●
●
●
●

User
Network
Hostname
Filesystem
Process table...
Introduction to Linux Containers
●

Benefits
–
–

Near native performance,

–

●

Application isolation,
Dynamic control o...
Introduction to Linux Containers
●

apt-get install lxc

●

lxc-create -t ubuntu -n <name>
–
–

Templates available - /usr...
Introduction to Linux Containers
●

lxc-ps – List processes running in container

●

lxc-ls – List container running on ho...
Introduction to Linux Containers
●

Light-weight virtualisation
–

●

No need for additional kernel nor
hypervisor/transla...
Introduction to Linux Containers
●

Libvirt integration

●

Can connect via
–
–

VNC,

–

VT: tty

–
●

Console (ssh,lxc-c...
What is Docker
●

Docker is an application deployment tool that
uses containers,

●

Runtime manager for containers,

●

A...
What is docker?
●

Docker runs as a
–

A daemon to manage lxc containers,

–

A cli for creating, managing lxc containers
...
What is docker?
●

docker search

●

docker pull

●

docker run

●

docker ps

●

docker inspect

●

docker images

●

doc...
What is docker?
●

docker run ping www.jumpingbean.co.za

●

sudo docker run -i -t base/arch /bin/bash
–

i interactive

–...
What is docker
●

Create an account on the repo server
–

●

Create a image on the repo server
–

●

sudo docker login
sud...
Upcoming SlideShare
Loading in...5
×

Linux Containers & Docker

2,540

Published on

Slides for a quick introduction to Linux containers (lxc) and Docker from a hands-on talk given at the Johannesburg Linux User Group on the 20th Jan 2014

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,540
On Slideshare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
35
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Linux Containers & Docker"

  1. 1. Introduction to Linux Containers & Docker Jozi Linux User Group – Jan 2014
  2. 2. Introduction to Linux Containers ● Makes use of: – Namespaces: ● ● ● ● ● User Network Hostname Filesystem Process table – Cgroups for resource limits – Seccomp – filtering of system calls – AppArmour/SELinux – Like chroot environment, only more secure and more full featured
  3. 3. Introduction to Linux Containers ● Benefits – – Near native performance, – ● Application isolation, Dynamic control of resource allocation, change during run time and resources only allocated as used Limitations – All use hosts kernel,
  4. 4. Introduction to Linux Containers ● apt-get install lxc ● lxc-create -t ubuntu -n <name> – – Templates available - /usr/share/lxc/templates/ – ● Default user/password: ubuntu/ubuntu Backing store - /var/lib/lxc Start a container – lxc-start -n <name> ● – Lxc-start -n <name> -d ● ● ● To shutdown issue “shutdown -h now” Attach lxc-console Detach via “ctrl-a q”
  5. 5. Introduction to Linux Containers ● lxc-ps – List processes running in container ● lxc-ls – List container running on host ● lxc-netstat – List routing table of container ● lxc-freeze – Pause a container ● lxc-unfreeze - Unpause a container ● lxc-shutdown – Shutdown a container ● lxc-destory – Hard stop a container ● lxc-monitor – monitor the state of a container ● lxc-cgroup – change resources allocated to a container ● lxc-clone/lxc-backup/lxc-restore ….
  6. 6. Introduction to Linux Containers ● Light-weight virtualisation – ● No need for additional kernel nor hypervisor/translation layer Network setup similar to virtualisaiton – Bridged or – Routed (Natted)
  7. 7. Introduction to Linux Containers ● Libvirt integration ● Can connect via – – VNC, – VT: tty – ● Console (ssh,lxc-console) VT: x Autostart on startup /etc/lxc/auto
  8. 8. What is Docker ● Docker is an application deployment tool that uses containers, ● Runtime manager for containers, ● Allows for image repository, ● Pushing of incremental changes from dev,test,production
  9. 9. What is docker? ● Docker runs as a – A daemon to manage lxc containers, – A cli for creating, managing lxc containers – A client to access repositories for images
  10. 10. What is docker? ● docker search ● docker pull ● docker run ● docker ps ● docker inspect ● docker images ● docker push
  11. 11. What is docker? ● docker run ping www.jumpingbean.co.za ● sudo docker run -i -t base/arch /bin/bash – i interactive – t terminal ● Sudo docker run -i -t mmckeen/opensuse-13.1 -p 80 ● docker port name 8080 – ● List local host port that has been forwared to 8080 docker run -d
  12. 12. What is docker ● Create an account on the repo server – ● Create a image on the repo server – ● sudo docker login sudo docker commit $CONTAINER_ID username/container-name Update your image on the repo server – sudo docker push username/container-name
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×