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
Introduction to Docker
Search
John Downey
February 06, 2014
Programming
3
130
Introduction to Docker
Given at the first Chicago Docker meetup
John Downey
February 06, 2014
Tweet
Share
More Decks by John Downey
See All by John Downey
Cryptography Pitfalls at CactusCon 2019
jtdowney
0
140
Intro to Cybersecurity Workshop
jtdowney
0
110
Cryptography Pitfalls at BsidesMSP 2017
jtdowney
0
140
Cryptography Pitfalls at THOTCON 0x8
jtdowney
0
160
Cryptography Pitfalls at ConFoo Montreal 2017
jtdowney
1
310
Cryptography Pitfalls at BSidesPhilly 2016
jtdowney
0
120
Cryptography Pitfalls at LASCON 2016
jtdowney
0
170
Debugging TLS/SSL at DevOps Days Detroit 2016
jtdowney
1
200
Debugging TLS/SSL at DevOpsDays Boston
jtdowney
1
280
Other Decks in Programming
See All in Programming
データアナリストが行うDatabricksを活用したETLの自動化事例
shinoa
0
270
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
420
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
370
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Apache Hive 4 on Treasure Data
ryukobayashi
0
290
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
1
100
ゆるい個人開発のススメ
kuroppe1819
10
990
Let's learn code review
riofujimon
1
270
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
230
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
780
Featured
See All Featured
Writing Fast Ruby
sferik
621
60k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
What the flash - Photography Introduction
edds
64
11k
Adopting Sorbet at Scale
ufuk
68
8.6k
Docker and Python
trallard
34
2.7k
Fireside Chat
paigeccino
21
2.6k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.5k
Raft: Consensus for Rubyists
vanstee
132
6.3k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
Testing 201, or: Great Expectations
jmmastey
28
6.4k
What's new in Ruby 2.0
geeforr
337
31k
Transcript
John Downey | @jtdowney
None
None
Laptop CI QA Staging Prod Rails code ? ? ?
? ? PostgreSQL ? ? ? ? ? RabbitMQ ? ? ? ? ? libxyz ? ? ? ? ?
http://www.flickr.com/photos/neonman/1438473495/
LXC Linux Containers
LXC: LINUX CONTAINERS • Linux host (kernel >= 2.6.29) •
Linux container (guest) • Must match host architecture • No need to match kernel/distro
DOCKER • Builds on LXC • Server (host) mode requires
Linux and LXC • Recommend kernel >= 3.8 • Client mode runs almost anywhere (Linux/OS X)
WHAT DOCKER ADDS • Images • Layers • Tags •
Repository • Create and share images
DOCKER COMMAND • Written in Go • Open source •
Manages containers and images • Provides HTTP API • Built in CLI client uses API
ADVANTAGES OVER A VM • Package a run-time environment •
Runnable on any linux host • Keeps things isolated and ephemeral • Fast and simple
IMAGES
IMAGES VS CONTAINERS • Images are a template • File
system • Metadata (ports to expose, command to run) • Containers are what is running
IMAGE LAYERS • Images are built up from layers •
Each layer is read-only filesystem • Top layer is a new read-write layer
None
IMAGE HIERARCHY • Form a directed tree • Each image
can specify a parent image • Starts with the parents layers below its own
Ubuntu App A B C DB A B
WAYS TO MAKE IMAGES • Commit a running container (docker
commit) • Dockerfile (docker build) • Import a tarball (docker import)
DOCKERFILE • FROM - What my parent image is •
RUN - Perform a command to prepare the image • ADD - Add a file to the image • EXPOSE - Allow access to a specified port • ENV - Set an environment variable • CMD - Default command to run on container creation
FROM wheezy-base ! ENV DEBIAN_FRONTEND noninteractive ! RUN apt-get install
-y ruby1.9.1 ruby1.9.1-dev RUN apt-get install -y build-essential RUN apt-get install -y libpq-dev RUN apt-get install -y libxml2-dev libxslt-dev RUN apt-get install -y libcurl4-openssl-dev RUN gem install bundler ! EXPOSE 3000 ! WORKDIR /gateway ADD . /gateway/ RUN bundle install ! CMD ["bundle", "exec", "rails", "server", "thin"]
REPOSITORY / INDEX
None