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
120
0
Share
Introduction to Docker
A short introduction to Docker at the Web Dev Melbourne meetup
Michael Sauter
March 13, 2014
More Decks by Michael Sauter
See All by Michael Sauter
Don't Aim for Reusability
michaelsauter
2
500
Ruby Development Environment with Docker
michaelsauter
0
70
Other Decks in Technology
See All in Technology
Building a Standalone Programming Environment
harukasan
PRO
1
100
ネットワーク運用を楽にするAWS DevOps Agent活用法!! / 20260421 Masaki Okuda
shift_evolve
PRO
2
230
マルチプロダクトの信頼性を効率良く保っていくために
kworkdev
PRO
0
180
生成AI時代のドキュメントに対する期待の整理と実践から得た学び / Rethinking Documentation for LLM: Lessons from Practice
bitkey
PRO
1
100
20260428_Product Management Summit_tadokoroyoshiro
tadokoro_yoshiro
14
15k
20260423_執筆の工夫と裏側 技術書の企画から刊行まで / From the planning to the publication of technical book
nash_efp
3
600
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
79k
Oracle Cloud Infrastructure:2026年4月度サービス・アップデート
oracle4engineer
PRO
0
110
これからの「データマネジメント」の話をしよう
sansantech
PRO
0
150
MLOps導入のための組織作りの第一歩
akasan
0
390
巨大プラットフォームを進化させる「第3のROI」
recruitengineers
PRO
2
1.3k
Do Ruby::Box dream of Modular Monolith?
joker1007
1
360
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
170
The Pragmatic Product Professional
lauravandoore
37
7.2k
Facilitating Awesome Meetings
lara
57
6.8k
We Have a Design System, Now What?
morganepeng
55
8.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
Navigating Team Friction
lara
192
16k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
Unsuck your backbone
ammeep
672
58k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Designing Experiences People Love
moore
143
24k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
280
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