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
440
Ruby Development Environment with Docker
michaelsauter
0
65
Other Decks in Technology
See All in Technology
プロジェクトマネージャーに最後まで残るたった一つの仕事は交渉
ichimichi
1
150
AIの電力問題を概観する
rmaruy
1
230
メルカリにおけるデータアナリティクス AI エージェント「Socrates」と ADK 活用事例
na0
12
4.6k
キャッシュレス決済のプロダクトから決済基盤への進化
b1a9id
0
130
Applied NLP in the Age of Generative AI: Future-Proof Strategies for Banking and Finance
inesmontani
PRO
0
160
ソフトウェアテストのAI活用_ver1.10
fumisuke
0
250
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
38k
JavaのMCPサーバーで体験するAIエージェントの世界
tatsuya1bm
1
180
Cursor Meetup Tokyo
iamshunta
5
1.4k
Amazon DevOps Guru のベースラインを整備して1ヶ月ほど運用してみた #jawsug_asa / Amazon DevOps Guru trial
masahirokawahara
2
170
FastMCPでSQLをチェックしてくれるMCPサーバーを自作してCursorから動かしてみた
nayuts
1
250
kintone開発組織のDevOpsへの移り変わりと実践
ueokande
1
260
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
What's in a price? How to price your products and services
michaelherold
245
12k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
106
19k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
How to train your dragon (web standard)
notwaldorf
92
6.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Facilitating Awesome Meetings
lara
54
6.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
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