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 multi-environment
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Abdala Cerqueira
August 31, 2018
Technology
390
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Docker: multi-stage multi-environment
Talk given on Unconference Track in LaraconEU 2018
Abdala Cerqueira
August 31, 2018
More Decks by Abdala Cerqueira
See All by Abdala Cerqueira
Docker: multi-stage and multi-environment
abdala
3
740
Programação também é mágica
abdala
0
180
Websockets e você, tudo a ver
abdala
1
140
PHP em todos os lugares
abdala
1
150
Automatizado rotinas com sua linguagem favorita
abdala
0
120
PHPUnit, ele irá te salvar!
abdala
0
110
Presente! Software Livre
abdala
0
82
Other Decks in Technology
See All in Technology
あけおめLINE 傾向とその対策
nasa9084
0
170
その Lambda、8分で 管理者権限まで奪われます
k1nakayama
6
3.1k
GoのInterface内部構造から学ぶ!最高パフォーマンスを出すコード設計
yappli_developers
0
180
SREの視点で考えるSIEM活用術 〜AWS環境でのセキュリティ強化〜
cscengineer
PRO
0
120
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
750
LLMに渡さなかった仕事
nanaism
0
960
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.6k
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
340
絵ではじめるKubernetesセキュリティ
aoi1
4
680
Railsのように考える: See through the Master
snoozer05
PRO
4
1.1k
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
870
Minecraft JavaのMODをSwiftで作る
1mash0
0
180
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
Leo the Paperboy
mayatellez
10
2.3k
Product Roadmaps are Hard
iamctodd
55
13k
Mind Mapping
helmedeiros
1
360
Done Done
chrislema
186
16k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Mobile First: as difficult as doing things right
swwweet
225
10k
Side Projects
sachag
456
43k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
260
Optimising Largest Contentful Paint
csswizardry
37
4k
Designing for Performance
lara
611
70k
Transcript
Docker: Multi-stage multi-environment Abdala Cerqueira
Dockerfile
FROM COPY --from= docker build --target
Problems
Problem 1 • Keep different Dockerfiles per environment • !
dev tools and dependencies on production
Problem 2 • Big, huge, immense images • One or
two commands may leave images out of control
Dependencies
Checklist • Have only one Dockerfile • Use the same
Dockerfile for all environments (dev, test, prod) • Create small images • Manage less dependencies
Official PHP image • One Dockerfile • All environments •
Small images • Less dependencies Time: ~39s Size: 430MB Security problems
Multi-stage
Official PHP image multi-stage • One Dockerfile • All environments
• Small images • Less dependencies Time: ~40s Size: 393MB Not that small, hidden dependencies
Alpine image • One Dockerfile • All environments • Small
images • Less dependencies Time: ~11s Size: 59.4MB Still have unwanted dependencies
Alpine image multi-stage • One Dockerfile • All environments •
Small images • Less dependencies Time: ~16s Size: 35.8MB This is ART <3
Comparison table Image Time Size alpine:3.8 - 4.41 MB php:7.2-apache
- 377 MB laravel-apache 39s 430 MB laravel-apache-multi 40s 393 MB laravel-alpine 11s 59.4 MB laravel-alpine-multi 16s 35.8 MB
Conclusion • Care about dependencies • Try different techniques
Thanks!