Exploring Docker
at Gilt
A few concepts first...
●
●
●
●
●
●
●

cgroups
namespaces
chroot
containers
lxc
aufs
Containers are not VMs
Ok… so, what is docker?
● An easy way to create containers
○ Portable
○ Self-sufficient

● Uses lxc and aufs*
● Written in go
Ok… so, what is docker?
● 4 main components:
○
○
○
○

Dockerfile (image building tool)
A command line tool
A service api
A registry
Docker - dockerfile
# cat Dockerfile
FROM ubuntu:13.04
RUN apt-get install python-software-properties
RUN add-apt-repository ppa:duh/golang
RUN apt-get update
RUN apt-get install golang
ADD . /lalala
EXPOSE 5000
CMD cd /lalala && go run lalala.go

# docker build -t lalala:1.0.0 .
Docker - command line tool
#
#
#
#

docker
docker
docker
docker

run lalala:1.0.0
ps
kill 6465778d29e4
logs 6465778d29e4
Docker - service api
# docker run ubuntu echo “lalala”
POST /images/create
POST /containers/create
POST /containers/{id}/start

# docker ps
GET /containers/json
Docker - registry
● There is a public and a private option
● Public: index.docker.io
● It has an API
How we use docker @ gilt?
● We build images for every version of every
application.
● We deploy by pulling images to the selected
hosts and run containers.
Why we like Docker?
●
●
●
●

Lightweight runtime environments
Application isolation
Stable runtime environments
Repeatability
Questions???
Jonathan Leibiusky
(@xetorthio)
ionathan@gmail.com

Thanks!!!

Exploring Docker at Gilt

  • 1.
  • 2.
    A few conceptsfirst... ● ● ● ● ● ● ● cgroups namespaces chroot containers lxc aufs Containers are not VMs
  • 3.
    Ok… so, whatis docker? ● An easy way to create containers ○ Portable ○ Self-sufficient ● Uses lxc and aufs* ● Written in go
  • 4.
    Ok… so, whatis docker? ● 4 main components: ○ ○ ○ ○ Dockerfile (image building tool) A command line tool A service api A registry
  • 5.
    Docker - dockerfile #cat Dockerfile FROM ubuntu:13.04 RUN apt-get install python-software-properties RUN add-apt-repository ppa:duh/golang RUN apt-get update RUN apt-get install golang ADD . /lalala EXPOSE 5000 CMD cd /lalala && go run lalala.go # docker build -t lalala:1.0.0 .
  • 6.
    Docker - commandline tool # # # # docker docker docker docker run lalala:1.0.0 ps kill 6465778d29e4 logs 6465778d29e4
  • 7.
    Docker - serviceapi # docker run ubuntu echo “lalala” POST /images/create POST /containers/create POST /containers/{id}/start # docker ps GET /containers/json
  • 8.
    Docker - registry ●There is a public and a private option ● Public: index.docker.io ● It has an API
  • 9.
    How we usedocker @ gilt? ● We build images for every version of every application. ● We deploy by pulling images to the selected hosts and run containers.
  • 10.
    Why we likeDocker? ● ● ● ● Lightweight runtime environments Application isolation Stable runtime environments Repeatability
  • 11.