Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
docker-multi-stage-build
Search
Hirokazu Maruta
July 30, 2019
Technology
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
docker-multi-stage-build
dockerのマルチステージビルドについて登壇しました。
Lightning talk of docker and docker-multi-stage-build.
Hirokazu Maruta
July 30, 2019
More Decks by Hirokazu Maruta
See All by Hirokazu Maruta
encryption
mochisuna
0
130
わかった気になるチューリングマシン
mochisuna
0
82
Elementary algorithm
mochisuna
0
35
ssh-dynamic-forward
mochisuna
0
72
ServerlessFramework-Trello
mochisuna
0
40
TechBash Slack Reaction Award
mochisuna
0
56
techbash-clasp
mochisuna
0
110
vuejs-night-publish
mochisuna
0
1.3k
surprise-lt-for-intern-vol-2
mochisuna
0
63
Other Decks in Technology
See All in Technology
積み重なった技術負債への挑戦 〜初手としての全社ゴト化〜
techtekt
PRO
0
1.3k
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
130
Goodbye ShellScript, Hello File-based App
shunsock
0
120
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
3k
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.3k
作って終わりじゃないサーバーレス 〜9年運用する大規模EC物流API基盤の設計・運用のリアル〜
zozotech
PRO
0
110
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
25
16k
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
5
630
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
2k
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
350
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
2
930
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
150
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
700
The World Runs on Bad Software
bkeepers
PRO
72
12k
A Soul's Torment
seathinner
8
3.6k
Test your architecture with Archunit
thirion
2
2.4k
Done Done
chrislema
186
16k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
540
Being A Developer After 40
akosma
91
590k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
890
Transcript
DockerͰ ϚϧνεςʔδϏϧυ͍ͨ͠ɻ ͨ͘͠ͳ͍ʁ SaaS ·Δͨ
Έͳ͞Μ
Docker
ͬͯ·͢ΑͶʁ
ͬͯ·͢ΑͶʁ ͜͜Ͱ2~3ਓ খटΛ͛Δఆ
େมศརͰ͢ΑͶ͐ɾɾɾ
େมศརͰ͢ΑͶ͐ɾɾɾ ͜͜Ͱ͞Βʹ2~3ਓ খटΛ͛Δఆ
ͳΕͦ͜ʂ
Λ
ͬͱ͍͍ײ͡ʹ͍͍ͨʂ
DockerͰ ϚϧνεςʔδϏϧυ͍ͨ͠ɻ ͨ͘͠ͳ͍ʁ SaaS ·Δͨ
ࣗݾհ • ؙాʢ·ΔͨͻΖ͔ͣʣ • Twitter: @mochi_suna • giftee.co SaaSνʔϜΤϯδχΞ •
झຯɿϐΞϊɺϘυήɺΞΠίϯ࡞ʢΧούʣ • ࣗಈԽେ͖ɻख࡞ۀ͖Β͍ɻ • github: https://github.com/mochisuna
ࠓ͢͜ͱ • Dockerͷ֓ཁ • ϚϧνεςʔδϏϧυ • ؆୯ʹσϞ ඪɿ • ૣޱʹͳΓ͗͢ͳ͍
• ్தͰ͛ग़͞ͳ͍ • ڬΊΔͱ͜ΖͰωλΛڬΉ
Docker֓ཁ
͍͖ͳΓ࣭Ͱ͢
DockerͬͯԿʁ
Docker is Կʁ ίϯςφܕͷΦʔϓϯιʔε ԾԽΤϯδϯͷҰͭ ※ݫີʹԾԽ͍ͯ͠ͳ͍
ίϯςφܕͷ͏·ຯ • VMܕͷԾԽΤϯδϯʹൺѹతʹܰྔ • VMܕΑΓߏங࡞ۀ͕༰қ ※ೝΊΔ ίϯςφܕ ΞϓϦ ϗετOS DockerΤϯδϯ
VMܕ ϗετOS ΞϓϦ ԾOS
͞Βʹ࣭Ͱ͢
ͦΕͧΕͷҧ͍Կʁ • Dockerfile • docker image • docker container
Docker༻ޠ • ίϯςφɿ୯ҰOS্Ͱִ͞Εͨϓϩηε • Πϝʔδɿίϯςφͷىಈઃఆɻܗʁ • DockerfileɿΠϝʔδͷߏஙઃఆ
Docker༻ޠ • ίϯςφɿ୯ҰOS্Ͱִ͞Εͨϓϩηε • Πϝʔδɿίϯςφͷىಈઃఆɻܗʁ • DockerfileɿΠϝʔδͷߏஙઃఆ ίϯςφ Πϝʔδ Dockerfile
༨ஊɿDockerΠϝʔδʹ͍ͭͯ • dokerΠϝʔδෳͷ ΠϝʔδΛϨΠϠͱͯ͠ ࣋ͭ • ͏ଆ୯ҰͷΠϝʔδ ʹݟ͑Δ • FROM
/ ADD /COPY શͯΠϝʔδϨΠϠʹ ૬ http://docs.docker.jp/engine/userguide/storagedriver/imagesandcontainers.html
ͬͱࡶʹ ϕʔεΠϝʔδ ॻ͖ࠐΈϨΠϠ dockerΠϝʔδ
͞Βʹ༨ஊɿbuild context • Γ͕ͪ • ߏங࣌ʹશϑΝΠϧɾσΟϨΫτϦ͕ೖΔ • COPY/ADD໋ྩͷ༗ແؔͳ͘ೖΔ docker image
build -t <IMAGE:TAG> . ͜Ε
ͳΜͰ͜Μͳ͔ͨ͠ʁ
Docker༑ୡ͔ͩΒ ʘ͜Θ͘ͳ͍Αʂʗ
༑ୡͱ ͬͱྑ͘ͳΓ͍͔ͨΒ
ຊɿϚϧνεςʔδϏϧυ
ϚϧνεςʔδϏϧυ • Docker17.05Ҏ߱ͷػೳ • ࠓ·Ͱ࡞͖ͬͯͨͷͷ͍͍ͱ͜औΓ • ՄಡੑɾอकੑΛ୲อ • Dockerfile/Πϝʔδͷ࠷దԽ
ͲΏ͜ͱʁ }։ൃεςʔδ }ຊ൪εςʔδ
طଘΠϝʔδΛFROMʹͰ͖Δ • ҰͭͷDockerfile͕ෳͷΠϝʔδΛಡΉ • ϛιʹͳΔͷ ࠷ऴతͳΠϝʔδʹඞཁͳͷ͚͕ͩೖΔ = ΠϝʔδαΠζͷେ෯ݮྔ --from=<as ໊લ>
target ࢦఆͰߏஙͰ͖Δ • ཉ͍͠εςʔδΛࢦఆͯ͠buildͰ͖Δ • ௨ৗͷbuildͩͱຊ൪εςʔδ·Ͱbuild͞ΕΔ docker build -- target
<as໊લ> } docker-composeͰεςʔδࢦఆՄ
σϞ • ࡞Γ·ͨ͠ • ࡶαʔόʔαΠυ • ࡶϑϩϯτΤϯυ • ςετ͘Β͍ॻ͚ https://github.com/mochisuna/vue-go-sample
Google Cloud RunʹσϓϩΠ • ίϚϯυ2ൃ gcloud beta run deploy <service_name>
\ --image gcr.io/<project_id>/<image_name> --region <region> gcloud builds submit \ -- project <project_id> \ -- tag gcr.io/<project_id>/<image_name> <dir>
·ͱΊ • Docker༑ୡɺ͜Θ͘ͳ͍ʂ • Πϝʔδʹඞཁͳͷ͚ͩΛೖΕΑ͏ • ىಈߴԽɺӡ༻ޮԽɺϦεΫܰݮ • Cloud RunΫιศརɻGCP৴ऀʹͳΔΘɻ