SlideShare a Scribd company logo
Ladislav Prskavec
http://blog.prskavec.net
@abtris
23.11.2013
docker

4 years

CloudFlare
packer

SoundCloud
Canonical's JuJu

serf
What is docker?
an open source project to pack,
ship and run any application as
a lightweight container
Why container?
Analogy from logistics
build once, 

run anywhere
~ developer
configure once, 

run anything
~ operations
Containers are 

to Virtual Machines 

as threads are to processes. 

Or you can think of them as
chroots on steroids.

~ Will Sargent
What is container in docker?
•

Kernel namespaces (ipc, uts, mount, pid, network
and user)

•

Chroots (using pivot_root)

•

Apparmor and SELinux profiles

•

Kernel capabilities

•

Control groups (cgroups)

•

AUFS or replacement in 0.7 version and later
Container
A

Container
B

Docker Engine

HOST OS

SERVER

Container
C
APP
A

Container
A

Container
B

Container
C

APP
B

APP
C

Guest OS

Guest OS

Guest OS

Docker Engine

Hypervisor

HOST OS

HOST OS

SERVER

SERVER
Basics
Installation
Finding and
downloading images
docker	
  search	
  ubuntu
docker	
  pull	
  shykes/ubuntu
Running
docker	
  run	
  ubuntu	
  /bin/echo	
  hello	
  world	
  
!

docker	
  run	
  -­‐i	
  -­‐t	
  ubuntu	
  /bin/bash
Committing your
changes
docker	
  ps	
  -­‐l
docker	
  commit	
  ID	
  base/with_curl
Pushing an image to
the repository
docker	
  push	
  abtris/curl
docker	
  push	
  internal_repository:5000/curl
Image
Parent Image
Dockerfile Best Practices
•

Use the cache

•

Use tags

•

EXPOSE-ing ports

•

CMD and ENTRYPOINT syntax

•

CMD and ENTRYPOINT better together
Use the cache
FROM	
  ubuntu:latest	
  
MAINTAINER	
  Ladislav	
  Prskavec	
  
!

RUN	
  echo	
  "deb	
  http://archive.ubuntu.com/ubuntu	
  
precise	
  main	
  universe"	
  >	
  /etc/apt/sources.list	
  
!

RUN	
  apt-­‐get	
  update	
  	
  
RUN	
  apt-­‐get	
  -­‐y	
  upgrade
Use tags
!

docker	
  build	
  -­‐t="abtris/sentry"	
  .
EXPOSE-ing ports
!

#	
  private	
  and	
  public	
  mapping	
  
EXPOSE	
  80:8080	
  
!

#	
  private	
  only	
  
EXPOSE	
  80
CMD and ENTRYPOINT
!
!

CMD	
  /bin/echo	
  
#	
  or	
  
CMD	
  ["/bin/echo"]
CMD and ENTRYPOINT
better together
RUN	
  apt-­‐get	
  install	
  -­‐y	
  rethinkdb	
  

!
#	
  Rethinkdb	
  process	
  
EXPOSE	
  28015	
  
#	
  Rethinkdb	
  admin	
  console	
  
EXPOSE	
  8080	
  

!
#	
  Create	
  the	
  /rethinkdb_data	
  dir	
  structure	
  
RUN	
  /usr/bin/rethinkdb	
  create	
  

!
ENTRYPOINT	
  ["/usr/bin/rethinkdb"]	
  

!
CMD	
  ["-­‐-­‐help"]
docker run crosbymichael/rethinkdb
Running	
  'rethinkdb'	
  will	
  create	
  a	
  new	
  data	
  directory	
  or	
  use	
  an	
  existing	
  one,	
  
	
  	
  and	
  serve	
  as	
  a	
  RethinkDB	
  cluster	
  node.	
  
File	
  path	
  options:	
  
	
  	
  -­‐d	
  [	
  -­‐-­‐directory	
  ]	
  path	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  specify	
  directory	
  to	
  store	
  data	
  and	
  metadata	
  
	
  	
  -­‐-­‐io-­‐threads	
  n	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  how	
  many	
  simultaneous	
  I/O	
  operations	
  can	
  happen	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  at	
  the	
  same	
  time	
  

!

Machine	
  name	
  options:	
  
	
  	
  -­‐n	
  [	
  -­‐-­‐machine-­‐name	
  ]	
  arg	
  	
  	
  	
  	
  	
  	
  	
  	
  the	
  name	
  for	
  this	
  machine	
  (as	
  will	
  appear	
  in	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  the	
  metadata).	
  	
  If	
  not	
  specified,	
  it	
  will	
  be	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  randomly	
  chosen	
  from	
  a	
  short	
  list	
  of	
  names.	
  

!

Network	
  options:	
  
	
  	
  -­‐-­‐bind	
  {all	
  |	
  addr}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  add	
  the	
  address	
  of	
  a	
  local	
  interface	
  to	
  listen	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  on	
  when	
  accepting	
  connections;	
  loopback	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  addresses	
  are	
  enabled	
  by	
  default	
  
	
  	
  -­‐-­‐cluster-­‐port	
  port	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  port	
  for	
  receiving	
  connections	
  from	
  other	
  nodes	
  
	
  	
  -­‐-­‐driver-­‐port	
  port	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  port	
  for	
  rethinkdb	
  protocol	
  client	
  drivers	
  
	
  	
  -­‐o	
  [	
  -­‐-­‐port-­‐offset	
  ]	
  offset	
  	
  	
  	
  	
  	
  	
  all	
  ports	
  used	
  locally	
  will	
  have	
  this	
  value	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  added	
  
	
  	
  -­‐j	
  [	
  -­‐-­‐join	
  ]	
  host:port	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  host	
  and	
  port	
  of	
  a	
  rethinkdb	
  node	
  to	
  connect	
  to	
  
	
  	
  .................
docker run crosbymichael/rethinkdb —bind all
info:	
  Running	
  rethinkdb	
  1.7.1-­‐0ubuntu1~precise	
  (GCC	
  4.6.3)...	
  
info:	
  Running	
  on	
  Linux	
  3.2.0-­‐45-­‐virtual	
  x86_64	
  
info:	
  Loading	
  data	
  from	
  directory	
  /rethinkdb_data	
  
warn:	
  Could	
  not	
  turn	
  off	
  filesystem	
  caching	
  for	
  database	
  file:	
  "/
rethinkdb_data/metadata"	
  (Is	
  the	
  file	
  located	
  on	
  a	
  filesystem	
  
that	
  doesn't	
  support	
  direct	
  I/O	
  (e.g.	
  some	
  encrypted	
  or	
  journaled	
  
file	
  systems)?)	
  This	
  can	
  cause	
  performance	
  problems.	
  
warn:	
  Could	
  not	
  turn	
  off	
  filesystem	
  caching	
  for	
  database	
  file:	
  "/
rethinkdb_data/auth_metadata"	
  (Is	
  the	
  file	
  located	
  on	
  a	
  
filesystem	
  that	
  doesn't	
  support	
  direct	
  I/O	
  (e.g.	
  some	
  encrypted	
  
or	
  journaled	
  file	
  systems)?)	
  This	
  can	
  cause	
  performance	
  problems.	
  
info:	
  Listening	
  for	
  intracluster	
  connections	
  on	
  port	
  29015	
  
info:	
  Listening	
  for	
  client	
  driver	
  connections	
  on	
  port	
  28015	
  
info:	
  Listening	
  for	
  administrative	
  HTTP	
  connections	
  on	
  port	
  8080	
  
info:	
  Listening	
  on	
  addresses:	
  127.0.0.1,	
  172.16.42.13	
  
info:	
  Server	
  ready	
  
info:	
  Someone	
  asked	
  for	
  the	
  nonwhitelisted	
  file	
  /js/
handlebars.runtime-­‐1.0.0.beta.6.js,	
  if	
  this	
  should	
  be	
  accessible	
  
add	
  it	
  to	
  the	
  whitelist.
git clone https://gist.github.com/abtris/7548643

docker build .
FROM	
  ubuntu:latest	
  
MAINTAINER	
  Ladislav	
  Prskavec	
  <ladislav@prskavec.net>	
  
RUN	
  apt-­‐get	
  update	
  	
  
RUN	
  apt-­‐get	
  -­‐y	
  upgrade	
  
RUN	
  DEBIAN_FRONTEND=noninteractive	
  apt-­‐get	
  -­‐y	
  install	
  
curl	
  apache2	
  libapache2-­‐mod-­‐php5	
  vim-­‐tiny	
  	
  
RUN	
  chown	
  -­‐R	
  www-­‐data:www-­‐data	
  /var/www/	
  
EXPOSE	
  80	
  
EXPOSE	
  22	
  
CMD	
  ["/bin/bash"]

Dockerfile
Use raw Dockerfile
1. Cache wins.
2. Chef, ansible, etc, does not use cache.
3. Raw Dockerfile uses cache.
4. Raw Dockerfile wins.
Links
•

If you have a docker container with the name CONTAINER
(specified by docker run -name CONTAINER) and in the
Dockerfile, it has an exposed port: 

EXPOSE 1337

•

docker run -d -link CONTAINER:ALIAS -name LINKED
user/wordpress

•

CONTAINER will show up in LINKED with the following
environment variables:

$ALIAS_PORT_1337_TCP_PORT
$ALIAS_PORT_1337_TCP_ADDR
Container Lifecycle
•

docker run - creates a container.

•

docker stop stops it.

•

docker start will start it again.

•

docker restart restarts a container.

•

docker rm deletes a container.

•

docker attach will connect to a running container.

•

docker wait blocks until container stops.
Container Info
•

docker ps shows running containers.

•

docker ps -a shows running and stopped containers.

•

docker inspect looks at all the info on a container (including IP
address).

•

docker logs gets logs from container.

•

docker events gets events from container.

•

docker port shows public facing port of container.

•

docker top shows running processes in container.
Import / Export

•

docker cp copies into a container.

•

docker export turns container fs into tarball.
Images Lifecycle
•

docker import creates an image from a tarball.

•

docker build creates image from Dockerfile.

•

docker commit creates image from a container.

•

docker rmi removes an image.

•

docker insert inserts a file from URL into image
Images Info
•

docker images shows all images

•

docker history shows history of image

•

docker tag tags an image to a name (local or
registry)
Registry & Repository
•

docker search searches registry for image

•

docker pull pulls an image from registry to local
machine

•

docker push pushes an image to the registry from
local machine.
Good practices
•

Install a internal docker registry

•

Install Shipyard

•

Create base image

•

Build from your base image

•

Push your images

•

Save off your registry
Install a internal docker
registry
Install an internal registry (the fast way) and run it as a
daemon:


•




docker	
  run	
  -­‐name	
  internal_registry	
  -­‐d	
  -­‐p	
  
5000:5000	
  samalba/docker-­‐registry	
  
•

Alias server to localhost

echo	
  "127.0.0.1	
  	
  	
  	
  	
  	
  internal_registry"	
  >>	
  /etc/
host	
  

•

Check internal_registry exists and is running on port 5000:

curl	
  -­‐-­‐get	
  -­‐-­‐verbose	
  http://internal_registry:5000/v1/
_ping
Create base image
•

Create a Dockerfile with initialization code such as
`apt-get update / apt-get install’ etc: this is your
base.

•

Build your base image, then push it to the internal
registry with 




docker	
  build	
  -­‐t	
  internal_registry:5000/
base	
  .
Build from your base image

•

Build all of your other Dockerfile pull from “base”
instead of ubuntu.

•

Keep playing around until you have your images
working.
Push your images
Push all of your images into the internal registry.


•




docker	
  tag	
  IMAGE-­‐ID	
  abtris/apache




docker	
  push	
  internal_registry:5000/apache
Save off your registry
If you need to blow away your Vagrant or set
someone else up, it’s much faster to do it with all
the images still intact:


•




docker	
  export	
  internal_registry	
  >	
  
internal_registry.tar




gzip	
  internal_registry.tar




mv	
  internal_registry.tar.gz	
  /vagrant
Projects uses docker
http://opdemand.com/
http://deis.io/

http://coreos.com/
https://flynn.io/

https://github.com/progrium/dokku
http://index.docker.io
https://index.docker.io/u/
abtris/devfest-2013/
http://shipyard-project.com/
docker.io
!

https://plus.google.com/u/1/
communities/108146856671494713993
demo files
https://github.com/abtris/devfest-2013
docker cheat sheet
https://gist.github.com/wsargent/7049221
docker sources
http://bit.ly/dockersources

More Related Content

What's hot

JRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing WorldJRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing World
SATOSHI TAGOMORI
 
Making Your Capistrano Recipe Book
Making Your Capistrano Recipe BookMaking Your Capistrano Recipe Book
Making Your Capistrano Recipe Book
Tim Riley
 
OSv at Cassandra Summit
OSv at Cassandra SummitOSv at Cassandra Summit
OSv at Cassandra Summit
Don Marti
 
DCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveDCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep dive
Madhu Venugopal
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
Kim Stefan Lindholm
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 
Amazon EC2 Container Service in Action
Amazon EC2 Container Service in ActionAmazon EC2 Container Service in Action
Amazon EC2 Container Service in Action
Remotty
 
Testing Wi-Fi with OSS Tools
Testing Wi-Fi with OSS ToolsTesting Wi-Fi with OSS Tools
Testing Wi-Fi with OSS Tools
All Things Open
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
DataStax Academy
 
Why you’re going to fail running java on docker!
Why you’re going to fail running java on docker!Why you’re going to fail running java on docker!
Why you’re going to fail running java on docker!
Red Hat Developers
 
Chaos Engineering for Docker
Chaos Engineering for DockerChaos Engineering for Docker
Chaos Engineering for Docker
Alexei Ledenev
 
Apache Traffic Server & Lua
Apache Traffic Server & LuaApache Traffic Server & Lua
Apache Traffic Server & Lua
Kit Chan
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
Open Source Consulting
 
Elasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep diveElasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep dive
Sematext Group, Inc.
 
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with KubernetesKubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
KubeAcademy
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo
Nuxeo
 
Container Monitoring with Sysdig
Container Monitoring with SysdigContainer Monitoring with Sysdig
Container Monitoring with Sysdig
Sreenivas Makam
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
DongHyeon Kim
 
[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus
[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus
[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus
OpenStack Korea Community
 
HBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with ClusterdockHBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with Clusterdock
Michael Stack
 

What's hot (20)

JRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing WorldJRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing World
 
Making Your Capistrano Recipe Book
Making Your Capistrano Recipe BookMaking Your Capistrano Recipe Book
Making Your Capistrano Recipe Book
 
OSv at Cassandra Summit
OSv at Cassandra SummitOSv at Cassandra Summit
OSv at Cassandra Summit
 
DCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveDCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep dive
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Amazon EC2 Container Service in Action
Amazon EC2 Container Service in ActionAmazon EC2 Container Service in Action
Amazon EC2 Container Service in Action
 
Testing Wi-Fi with OSS Tools
Testing Wi-Fi with OSS ToolsTesting Wi-Fi with OSS Tools
Testing Wi-Fi with OSS Tools
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
Why you’re going to fail running java on docker!
Why you’re going to fail running java on docker!Why you’re going to fail running java on docker!
Why you’re going to fail running java on docker!
 
Chaos Engineering for Docker
Chaos Engineering for DockerChaos Engineering for Docker
Chaos Engineering for Docker
 
Apache Traffic Server & Lua
Apache Traffic Server & LuaApache Traffic Server & Lua
Apache Traffic Server & Lua
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
 
Elasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep diveElasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep dive
 
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with KubernetesKubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo
 
Container Monitoring with Sysdig
Container Monitoring with SysdigContainer Monitoring with Sysdig
Container Monitoring with Sysdig
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus
[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus
[OpenInfra Days Korea 2018] Day 2 - E6 - OpenInfra monitoring with Prometheus
 
HBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with ClusterdockHBaseConEast2016: HBase on Docker with Clusterdock
HBaseConEast2016: HBase on Docker with Clusterdock
 

Similar to Docker.io

Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
Ben Hall
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
Ricardo Amaro
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PROIDEA
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
psconnolly
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
MuhammadShoaibHussai2
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Cloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - ContainersCloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - Containers
Linjith Kunnon
 
moscmy2016: Extending Docker
moscmy2016: Extending Dockermoscmy2016: Extending Docker
moscmy2016: Extending Docker
Mohammad Fairus Khalid
 
Docker, but what it is?
Docker, but what it is?Docker, but what it is?
Docker, but what it is?
Julien Maitrehenry
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
Akihiro Suda
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
Sabyrzhan Tynybayev
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
LorisPack Project
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Nova
clayton_oneill
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
D
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
Docker security
Docker securityDocker security
Docker security
Janos Suto
 
Docker practice
Docker practiceDocker practice
Docker practice
wonyong hwang
 
Rootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesRootless Containers & Unresolved issues
Rootless Containers & Unresolved issues
Akihiro Suda
 
Introduction to containers
Introduction to containersIntroduction to containers
Introduction to containers
Nitish Jadia
 

Similar to Docker.io (20)

Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
Cloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - ContainersCloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - Containers
 
moscmy2016: Extending Docker
moscmy2016: Extending Dockermoscmy2016: Extending Docker
moscmy2016: Extending Docker
 
Docker, but what it is?
Docker, but what it is?Docker, but what it is?
Docker, but what it is?
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Nova
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
 
Docker security
Docker securityDocker security
Docker security
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Rootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesRootless Containers & Unresolved issues
Rootless Containers & Unresolved issues
 
Introduction to containers
Introduction to containersIntroduction to containers
Introduction to containers
 

More from Ladislav Prskavec

SRE in Apiary
SRE in ApiarySRE in Apiary
SRE in Apiary
Ladislav Prskavec
 
Modern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and MarkupModern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and Markup
Ladislav Prskavec
 
How you can kill Wordpress!
How you can kill Wordpress!How you can kill Wordpress!
How you can kill Wordpress!
Ladislav Prskavec
 
SRE in Startup
SRE in StartupSRE in Startup
SRE in Startup
Ladislav Prskavec
 
CI and CD
CI and CDCI and CD
Datascript: Serverless Architetecture
Datascript: Serverless ArchitetectureDatascript: Serverless Architetecture
Datascript: Serverless Architetecture
Ladislav Prskavec
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
Ladislav Prskavec
 
CI and CD
CI and CDCI and CD
PragueJS meetups 30th anniversary
PragueJS meetups 30th anniversaryPragueJS meetups 30th anniversary
PragueJS meetups 30th anniversary
Ladislav Prskavec
 
How to easy deploy app into any cloud
How to easy deploy app into any cloudHow to easy deploy app into any cloud
How to easy deploy app into any cloud
Ladislav Prskavec
 
Docker - modern platform for developement and operations
Docker - modern platform for developement and operationsDocker - modern platform for developement and operations
Docker - modern platform for developement and operations
Ladislav Prskavec
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
AWS Elastic Container Service
AWS Elastic Container ServiceAWS Elastic Container Service
AWS Elastic Container Service
Ladislav Prskavec
 
Comparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls APIComparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls API
Ladislav Prskavec
 
Docker Elastic Beanstalk
Docker Elastic BeanstalkDocker Elastic Beanstalk
Docker Elastic Beanstalk
Ladislav Prskavec
 
Docker včera, dnes a zítra
Docker včera, dnes a zítraDocker včera, dnes a zítra
Docker včera, dnes a zítra
Ladislav Prskavec
 
Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.
Ladislav Prskavec
 
Docker.io
Docker.ioDocker.io
AngularJS
AngularJSAngularJS
Firebase and AngularJS
Firebase and AngularJSFirebase and AngularJS
Firebase and AngularJS
Ladislav Prskavec
 

More from Ladislav Prskavec (20)

SRE in Apiary
SRE in ApiarySRE in Apiary
SRE in Apiary
 
Modern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and MarkupModern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and Markup
 
How you can kill Wordpress!
How you can kill Wordpress!How you can kill Wordpress!
How you can kill Wordpress!
 
SRE in Startup
SRE in StartupSRE in Startup
SRE in Startup
 
CI and CD
CI and CDCI and CD
CI and CD
 
Datascript: Serverless Architetecture
Datascript: Serverless ArchitetectureDatascript: Serverless Architetecture
Datascript: Serverless Architetecture
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
CI and CD
CI and CDCI and CD
CI and CD
 
PragueJS meetups 30th anniversary
PragueJS meetups 30th anniversaryPragueJS meetups 30th anniversary
PragueJS meetups 30th anniversary
 
How to easy deploy app into any cloud
How to easy deploy app into any cloudHow to easy deploy app into any cloud
How to easy deploy app into any cloud
 
Docker - modern platform for developement and operations
Docker - modern platform for developement and operationsDocker - modern platform for developement and operations
Docker - modern platform for developement and operations
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 
AWS Elastic Container Service
AWS Elastic Container ServiceAWS Elastic Container Service
AWS Elastic Container Service
 
Comparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls APIComparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls API
 
Docker Elastic Beanstalk
Docker Elastic BeanstalkDocker Elastic Beanstalk
Docker Elastic Beanstalk
 
Docker včera, dnes a zítra
Docker včera, dnes a zítraDocker včera, dnes a zítra
Docker včera, dnes a zítra
 
Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.
 
Docker.io
Docker.ioDocker.io
Docker.io
 
AngularJS
AngularJSAngularJS
AngularJS
 
Firebase and AngularJS
Firebase and AngularJSFirebase and AngularJS
Firebase and AngularJS
 

Recently uploaded

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 

Docker.io

  • 2.
  • 3.
  • 6. an open source project to pack, ship and run any application as a lightweight container
  • 9.
  • 10.
  • 11.
  • 12. build once, 
 run anywhere ~ developer
  • 13. configure once, 
 run anything ~ operations
  • 14. Containers are 
 to Virtual Machines 
 as threads are to processes. 
 Or you can think of them as chroots on steroids. ~ Will Sargent
  • 15. What is container in docker? • Kernel namespaces (ipc, uts, mount, pid, network and user) • Chroots (using pivot_root) • Apparmor and SELinux profiles • Kernel capabilities • Control groups (cgroups) • AUFS or replacement in 0.7 version and later
  • 17. APP A Container A Container B Container C APP B APP C Guest OS Guest OS Guest OS Docker Engine Hypervisor HOST OS HOST OS SERVER SERVER
  • 20. Finding and downloading images docker  search  ubuntu docker  pull  shykes/ubuntu
  • 21. Running docker  run  ubuntu  /bin/echo  hello  world   ! docker  run  -­‐i  -­‐t  ubuntu  /bin/bash
  • 22. Committing your changes docker  ps  -­‐l docker  commit  ID  base/with_curl
  • 23. Pushing an image to the repository docker  push  abtris/curl docker  push  internal_repository:5000/curl
  • 24. Image
  • 25.
  • 27. Dockerfile Best Practices • Use the cache • Use tags • EXPOSE-ing ports • CMD and ENTRYPOINT syntax • CMD and ENTRYPOINT better together
  • 28. Use the cache FROM  ubuntu:latest   MAINTAINER  Ladislav  Prskavec   ! RUN  echo  "deb  http://archive.ubuntu.com/ubuntu   precise  main  universe"  >  /etc/apt/sources.list   ! RUN  apt-­‐get  update     RUN  apt-­‐get  -­‐y  upgrade
  • 29. Use tags ! docker  build  -­‐t="abtris/sentry"  .
  • 30. EXPOSE-ing ports ! #  private  and  public  mapping   EXPOSE  80:8080   ! #  private  only   EXPOSE  80
  • 31. CMD and ENTRYPOINT ! ! CMD  /bin/echo   #  or   CMD  ["/bin/echo"]
  • 32. CMD and ENTRYPOINT better together RUN  apt-­‐get  install  -­‐y  rethinkdb   ! #  Rethinkdb  process   EXPOSE  28015   #  Rethinkdb  admin  console   EXPOSE  8080   ! #  Create  the  /rethinkdb_data  dir  structure   RUN  /usr/bin/rethinkdb  create   ! ENTRYPOINT  ["/usr/bin/rethinkdb"]   ! CMD  ["-­‐-­‐help"]
  • 33. docker run crosbymichael/rethinkdb Running  'rethinkdb'  will  create  a  new  data  directory  or  use  an  existing  one,      and  serve  as  a  RethinkDB  cluster  node.   File  path  options:      -­‐d  [  -­‐-­‐directory  ]  path                      specify  directory  to  store  data  and  metadata      -­‐-­‐io-­‐threads  n                                        how  many  simultaneous  I/O  operations  can  happen                                                                          at  the  same  time   ! Machine  name  options:      -­‐n  [  -­‐-­‐machine-­‐name  ]  arg                  the  name  for  this  machine  (as  will  appear  in                                                                          the  metadata).    If  not  specified,  it  will  be                                                                          randomly  chosen  from  a  short  list  of  names.   ! Network  options:      -­‐-­‐bind  {all  |  addr}                              add  the  address  of  a  local  interface  to  listen                                                                          on  when  accepting  connections;  loopback                                                                          addresses  are  enabled  by  default      -­‐-­‐cluster-­‐port  port                              port  for  receiving  connections  from  other  nodes      -­‐-­‐driver-­‐port  port                                port  for  rethinkdb  protocol  client  drivers      -­‐o  [  -­‐-­‐port-­‐offset  ]  offset              all  ports  used  locally  will  have  this  value                                                                          added      -­‐j  [  -­‐-­‐join  ]  host:port                      host  and  port  of  a  rethinkdb  node  to  connect  to      .................
  • 34. docker run crosbymichael/rethinkdb —bind all info:  Running  rethinkdb  1.7.1-­‐0ubuntu1~precise  (GCC  4.6.3)...   info:  Running  on  Linux  3.2.0-­‐45-­‐virtual  x86_64   info:  Loading  data  from  directory  /rethinkdb_data   warn:  Could  not  turn  off  filesystem  caching  for  database  file:  "/ rethinkdb_data/metadata"  (Is  the  file  located  on  a  filesystem   that  doesn't  support  direct  I/O  (e.g.  some  encrypted  or  journaled   file  systems)?)  This  can  cause  performance  problems.   warn:  Could  not  turn  off  filesystem  caching  for  database  file:  "/ rethinkdb_data/auth_metadata"  (Is  the  file  located  on  a   filesystem  that  doesn't  support  direct  I/O  (e.g.  some  encrypted   or  journaled  file  systems)?)  This  can  cause  performance  problems.   info:  Listening  for  intracluster  connections  on  port  29015   info:  Listening  for  client  driver  connections  on  port  28015   info:  Listening  for  administrative  HTTP  connections  on  port  8080   info:  Listening  on  addresses:  127.0.0.1,  172.16.42.13   info:  Server  ready   info:  Someone  asked  for  the  nonwhitelisted  file  /js/ handlebars.runtime-­‐1.0.0.beta.6.js,  if  this  should  be  accessible   add  it  to  the  whitelist.
  • 35. git clone https://gist.github.com/abtris/7548643
 docker build . FROM  ubuntu:latest   MAINTAINER  Ladislav  Prskavec  <ladislav@prskavec.net>   RUN  apt-­‐get  update     RUN  apt-­‐get  -­‐y  upgrade   RUN  DEBIAN_FRONTEND=noninteractive  apt-­‐get  -­‐y  install   curl  apache2  libapache2-­‐mod-­‐php5  vim-­‐tiny     RUN  chown  -­‐R  www-­‐data:www-­‐data  /var/www/   EXPOSE  80   EXPOSE  22   CMD  ["/bin/bash"] Dockerfile
  • 36. Use raw Dockerfile 1. Cache wins. 2. Chef, ansible, etc, does not use cache. 3. Raw Dockerfile uses cache. 4. Raw Dockerfile wins.
  • 37. Links • If you have a docker container with the name CONTAINER (specified by docker run -name CONTAINER) and in the Dockerfile, it has an exposed port: 
 EXPOSE 1337 • docker run -d -link CONTAINER:ALIAS -name LINKED user/wordpress • CONTAINER will show up in LINKED with the following environment variables:
 $ALIAS_PORT_1337_TCP_PORT $ALIAS_PORT_1337_TCP_ADDR
  • 38. Container Lifecycle • docker run - creates a container. • docker stop stops it. • docker start will start it again. • docker restart restarts a container. • docker rm deletes a container. • docker attach will connect to a running container. • docker wait blocks until container stops.
  • 39. Container Info • docker ps shows running containers. • docker ps -a shows running and stopped containers. • docker inspect looks at all the info on a container (including IP address). • docker logs gets logs from container. • docker events gets events from container. • docker port shows public facing port of container. • docker top shows running processes in container.
  • 40. Import / Export • docker cp copies into a container. • docker export turns container fs into tarball.
  • 41. Images Lifecycle • docker import creates an image from a tarball. • docker build creates image from Dockerfile. • docker commit creates image from a container. • docker rmi removes an image. • docker insert inserts a file from URL into image
  • 42. Images Info • docker images shows all images • docker history shows history of image • docker tag tags an image to a name (local or registry)
  • 43. Registry & Repository • docker search searches registry for image • docker pull pulls an image from registry to local machine • docker push pushes an image to the registry from local machine.
  • 44. Good practices • Install a internal docker registry • Install Shipyard • Create base image • Build from your base image • Push your images • Save off your registry
  • 45. Install a internal docker registry Install an internal registry (the fast way) and run it as a daemon:
 • 
 docker  run  -­‐name  internal_registry  -­‐d  -­‐p   5000:5000  samalba/docker-­‐registry   • Alias server to localhost
 echo  "127.0.0.1            internal_registry"  >>  /etc/ host   • Check internal_registry exists and is running on port 5000:
 curl  -­‐-­‐get  -­‐-­‐verbose  http://internal_registry:5000/v1/ _ping
  • 46. Create base image • Create a Dockerfile with initialization code such as `apt-get update / apt-get install’ etc: this is your base. • Build your base image, then push it to the internal registry with 
 
 docker  build  -­‐t  internal_registry:5000/ base  .
  • 47. Build from your base image • Build all of your other Dockerfile pull from “base” instead of ubuntu. • Keep playing around until you have your images working.
  • 48. Push your images Push all of your images into the internal registry.
 • 
 docker  tag  IMAGE-­‐ID  abtris/apache
 
 docker  push  internal_registry:5000/apache
  • 49. Save off your registry If you need to blow away your Vagrant or set someone else up, it’s much faster to do it with all the images still intact:
 • 
 docker  export  internal_registry  >   internal_registry.tar
 
 gzip  internal_registry.tar
 
 mv  internal_registry.tar.gz  /vagrant
  • 52.
  • 55. docker.io ! https://plus.google.com/u/1/ communities/108146856671494713993 demo files https://github.com/abtris/devfest-2013 docker cheat sheet https://gist.github.com/wsargent/7049221 docker sources http://bit.ly/dockersources