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
Michael Sauter
March 13, 2014
Technology
0
110
Introduction to Docker
A short introduction to Docker at the Web Dev Melbourne meetup
Michael Sauter
March 13, 2014
Tweet
Share
More Decks by Michael Sauter
See All by Michael Sauter
Don't Aim for Reusability
michaelsauter
2
450
Ruby Development Environment with Docker
michaelsauter
0
65
Other Decks in Technology
See All in Technology
つくって納得、つかって実感! 大規模言語モデルことはじめ
recruitengineers
PRO
30
11k
Grafana MCPサーバーによるAIエージェント経由でのGrafanaダッシュボード動的生成
hamadakoji
0
700
Product Management Conference -AI時代に進化するPdM-
kojima111
0
260
見てわかるテスト駆動開発
recruitengineers
PRO
6
2.2k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.6k
kintone開発チームの紹介
cybozuinsideout
PRO
0
73k
Vault meets Kubernetes
mochizuki875
0
140
現場が抱える様々な問題は “組織設計上” の問題によって生じていることがある / Team-oriented Organization Design 20250827
mtx2s
7
65k
7月のガバクラ利用料が高かったので調べてみた
techniczna
3
770
Lessons from CVE-2025-22869: Memory Debugging and OSS Vulnerability Reporting
vvatanabe
2
110
ライブサービスゲームQAのパフォーマンス検証による品質改善の取り組み
gree_tech
PRO
0
210
ZOZOTOWNフロントエンドにおけるディレクトリの分割戦略
zozotech
PRO
18
5.9k
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Why Our Code Smells
bkeepers
PRO
339
57k
Statistics for Hackers
jakevdp
799
220k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
830
GitHub's CSS Performance
jonrohan
1032
460k
Into the Great Unknown - MozCon
thekraken
40
2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Producing Creativity
orderedlist
PRO
347
40k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Documentation Writing (for coders)
carmenintech
73
5k
Transcript
Introduction to Docker by @michaelsauter
How do you develop for the web? Directly on your
OS? Inside a VM? There is another way ... Docker!
What is Docker? Based on Linux containers virtualization method for
running isolated Linux systems on a host Open-source tool to make it easy and accessible
It's like a ... Lightweight VM Isolated process just like
a VM, only smaller and faster run one process inside a container
What forms a Docker container?
Why Docker? Build once ... run anywhere isolated from host
(e.g. build locally, run remotely) Isolation between containers avoid dependency hell Automation & Abstraction build, start, stop, attach, remove etc. Reusable services (via Docker Index) MySQL, PostgreSQL, Redis, ... images playgrounds for frameworks?
Alright, alright, here's the demo ... ... a Sinatra blog!
Ruby Based on d11wtq/ruby , running bundle exec rackup Linked to ... PostgreSQL Using orchardup/postgresql , running postgres
PostgreSQL container # Create and start container docker run \
--env POSTGRESQL_DB=sinatra --env POSTGRESQL_USER=sinatra --env POSTGRESQL_PASS=sinatra \ --publish 5432:5432 \ --detach --name sinatra_db orchardup/postgresql
Sinatra container # Dockerfile (describes build steps) FROM d11wtq/ruby RUN
sudo apt-get install -y -q libpq-dev WORKDIR /data CMD bundle install --path vendor && bundle exec rake db:migrate && bundle exec rackup # Build image docker build -t michaelsauter/sinatra-example . # Create and start container docker run \ --env POSTGRESQL_DB=sinatra --env POSTGRESQL_USER=sinatra --env POSTGRESQL_PASS=sinatra \ --link sinatra_db:db \ --publish 9292:9292 \ --volume /Code/web-dev-meetup/app:/data \ --detach --name sinatra_app michaelsauter/sinatra-example # In app.rb db = URI.parse(ENV["DB_PORT"]) # Set by Docker, e.g. tcp://172.17.0.2:5432 ActiveRecord::Base.establish_connection( adapter: "postgresql", host: db.host, port: db.port, username: ENV["POSTGRESQL_USER"], password: ENV["POSTGRESQL_PASS"], database: ENV["POSTGRESQL_DB"], encoding: "utf8" )
Demo, for real Ok, I'll cheat: I have already downloaded
/ built the images, and I'm using a small tool, , which will save me the typing. Crane
Thank you! Questions? Sinatra environment available at github.com/michaelsauter/sinatra-crane-env BTW, this
presentation runs in Docker, too :) It's using a container running NodeJS to provide Markdown + speaker notes support for reveal.js