Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Meetup Docker 101
Search
ubermuda
May 28, 2014
Technology
1
200
Meetup Docker 101
A gentle introduction to Docker
ubermuda
May 28, 2014
Tweet
Share
More Decks by ubermuda
See All by ubermuda
La théorie des graphes appliquée à Git
ubermuda
0
370
Comment Docker révolutionne le web
ubermuda
3
670
Vers des applications twelve-factor
ubermuda
2
980
Git et la théorie des graph
ubermuda
3
960
Introduction à Docker
ubermuda
6
970
A multi-container Symfony2 setup with Docker
ubermuda
40
12k
Docker Introduction
ubermuda
5
420
Symfony 2, un framework robuste et moderne
ubermuda
5
170
Migration d'une base de code subversion vers git
ubermuda
0
83
Other Decks in Technology
See All in Technology
OCI Data Integration技術情報 / ocidi_technical_jp
oracle4engineer
PRO
1
2.6k
Deno+JSRでパッケージを作って公開する
askua
0
120
Railsで4GBのデカ動画ファイルのアップロードと配信、どう実現する?
asflash8
2
270
20241108_CS_LLMMT
shigashiyama
0
260
データの信頼性を支える仕組みと技術
chanyou0311
6
1.7k
TinyGoを使ったVSCode拡張機能実装
askua
2
210
第23回Ques_タイミーにおけるQAチームの在り方 / QA Team in Timee
takeyaqa
0
260
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
1
1k
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
500
The Role of Developer Relations in AI Product Success.
giftojabu1
0
110
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Teambox: Starting and Learning
jrom
133
8.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Navigating Team Friction
lara
183
14k
Docker and Python
trallard
40
3.1k
Embracing the Ebb and Flow
colly
84
4.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Unsuck your backbone
ammeep
668
57k
Ruby is Unlike a Banana
tanoku
96
11k
Transcript
Docker 101 Geoffrey Bachelet –@ubermuda
Who's talking? • Geoffrey Bachelet • Stage1.io : continuous staging
• Gustave.io : interactive staging • Freelance Developer / Trainer @ubermuda
Container Engine? Based on the Linux kernel's LXC instructions Processes
and resources isolation "chroot" on steroids / super lightweight VMs
Host OS Hypervisor Guest OS Guest OS Guest OS Guest
OS App App App App Host OS Docker + LXC App App App App VMs vs Containers
VMs vs Containers LXC / Jails / Zones / etc
Uses the host's kernel Boots in seconds 0 overhead (almost) Easy to pass around Hypervisor Boots a complete OS Boots in minutes Guest OS' overhead Several Go images
Image vs Container
credit: http:/ /docs.docker.io/en/latest/terms/image/ Image
Container credit: http:/ /docs.docker.io/en/latest/terms/image/
Create a container
$ docker run -‐i -‐t stackbrew/ubuntu /bin/bash ! root@21d86a0b8387:/#
Commit the container
root@21d86a0b8387:/# apt-‐get install nginx root@21d86a0b8387:/# exit ! $
docker ps -‐q -‐n 1 21d86a0b8387 ! $ docker commit 21d86a0b8387 sflive/nginx 240198b750c3cc950c60005d6d24cae4fc2dbcc6c31e274574af68d4a2e8 ! $ docker images REPOSITORY TAG IMAGE ID sflive/nginx latest 240198b750c3
root@21d86a0b8387:/# apt-‐get install nginx root@21d86a0b8387:/# exit ! $
docker ps -‐q -‐n 1 21d86a0b8387 ! $ docker commit 21d86a0b8387 sflive/nginx 240198b750c3cc950c60005d6d24cae4fc2dbcc6c31e274574af68d4a2e8 ! $ docker images REPOSITORY TAG IMAGE ID sflive/nginx latest 240198b750c3
root@21d86a0b8387:/# apt-‐get install nginx root@21d86a0b8387:/# exit ! $
docker ps -‐q -‐n 1 21d86a0b8387 ! $ docker commit 21d86a0b8387 sflive/nginx 240198b750c3cc950c60005d6d24cae4fc2dbcc6c31e274574af68d4a2e8 ! $ docker images REPOSITORY TAG IMAGE ID sflive/nginx latest 240198b750c3
root@21d86a0b8387:/# apt-‐get install nginx root@21d86a0b8387:/# exit ! $
docker ps -‐q -‐n 1 21d86a0b8387 ! $ docker commit 21d86a0b8387 sflive/nginx 240198b750c3cc950c60005d6d24cae4fc2dbcc6c31e274574af68d4a2e8 ! $ docker images REPOSITORY TAG IMAGE ID sflive/nginx latest 240198b750c3
Run the image
$ docker run -‐p 80 sflive/nginx nginx -‐g 'daemon off;'
$ docker run -‐p 80 sflive/nginx nginx -‐g 'daemon off;'
$ docker run -‐p 80 sflive/nginx nginx -‐g 'daemon off;'
$ docker run -‐p 80 sflive/nginx nginx -‐g 'daemon off;'
$ docker run -‐p 80 sflive/nginx nginx -‐g 'daemon off;'
$ docker run -‐p 80 sflive/nginx nginx -‐g 'daemon off;'
$ docker ps CONTAINER ID ... PORTS
923cb190dbc3 ... 0.0.0.0:49155-‐>80/tcp ! $ curl http://localhost:49155 <html> <head> <title>Welcome to nginx!</title> ...
$ docker ps CONTAINER ID ... PORTS
923cb190dbc3 ... 0.0.0.0:49155-‐>80/tcp ! $ curl http://localhost:49155 <html> <head> <title>Welcome to nginx!</title> ...
Dockerfile
credit: http:/ /docs.docker.io/en/latest/terms/image/
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
FROM stackbrew/ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-‐get install
-‐y nginx ADD nginx.conf /etc/nginx/nginx.conf EXPOSE 80 VOLUME ["/var/www"] CMD ["-‐g", "daemon off;"] ENTRYPOINT ["nginx"]
Features
• Docker CLI • run -d, attach, wait, ps, images,
rm, rmi, etc • Networking • Ambassador, advanced routing, etc • Volumes • Data containers, bindmounting, etc • Docker Index • thousands of ready-made images • Docker Registry • private Docker Index • Remote API • dockerode, Docker-PHP, etc
Docker CLI • run [-‐d] : execute a container •
attach : attach stdout • ps : list running containers • images : list existing images • rm / rmi : delete containers / images
Networking Link containers together Easy service discovery Ambassador pattern (service
portability)
Volumes Like NFS for docker (except it works) Store data
in data containers Easily backup data containers
Docker Index + Registry Thousands of ready-made images Private registry
Docker Remote API Rest(-ish) HTTP API for Docker ! Third
party client libraries: dockerode, Docker-php, etc
Orchestration
Host OS THE INTERNET container nginx mysql php5-fpm
Host OS THE INTERNET nginx mysql php5-fpm /var/www /var/lib/mysql
Not built-in Lots of third-party tools ! maestro-ng, Fig, Gaudi,
etc.
Pets vs Cattle
Use cases
Dev. environments Continuous integration Continuous deployment 0 downtime deployment Private
PaaS
Thanks! https://speackerdeck.com/ubermuda/meetup-docker-101 Geoffrey Bachelet – @ubermuda