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
100
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
400
Ruby Development Environment with Docker
michaelsauter
0
61
Other Decks in Technology
See All in Technology
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
410
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
130
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.3k
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
B2B SaaS × AI機能開発 〜テナント分離のパターン解説〜 / B2B SaaS x AI function development - Explanation of tenant separation pattern
oztick139
2
220
元旅行会社の情シス部員が教えるおすすめなre:Inventへの行き方 / What is the most efficient way to re:Invent
naospon
2
330
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
580
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
180
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Being A Developer After 40
akosma
86
590k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
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