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
Docker: multi-stage multi-environment
Search
Abdala Cerqueira
August 31, 2018
Technology
0
360
Docker: multi-stage multi-environment
Talk given on Unconference Track in LaraconEU 2018
Abdala Cerqueira
August 31, 2018
Tweet
Share
More Decks by Abdala Cerqueira
See All by Abdala Cerqueira
Docker: multi-stage and multi-environment
abdala
4
620
Programação também é mágica
abdala
0
150
Websockets e você, tudo a ver
abdala
1
120
PHP em todos os lugares
abdala
1
130
Automatizado rotinas com sua linguagem favorita
abdala
0
92
PHPUnit, ele irá te salvar!
abdala
0
79
Presente! Software Livre
abdala
0
62
Other Decks in Technology
See All in Technology
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2025年版)
infiniteloop_inc
0
3.6k
AWSを利用する上で知っておきたい名前解決の話
nagisa53
6
770
Azure × MCP 入門
ry0y4n
8
1.5k
製造業向けIoTソリューション提案資料.pdf
haruki_uiru
0
220
Part1 GitHubってなんだろう?その1
tomokusaba
3
690
Serverlessだからこそコードと設計にはこだわろう
kenichirokimura
2
790
続・やっぱり余白が大切だった話
kakehashi
PRO
2
290
3D生成AIのための画像生成
kosukeito
2
610
DynamoDB のデータを QuickSight で可視化する際につまづいたこと/stumbling-blocks-when-visualising-dynamodb-with-quicksight
emiki
0
140
MCPが変えるAIとの協働
knishioka
1
140
ソフトウェアテスト 最初の一歩 〜テスト設計技法をワークで体験しながら学ぶ〜 #JaSSTTokyo / SoftwareTestingFirstStep
nihonbuson
PRO
1
110
企業が押さえるべきMCPの未来
takaakikakei
4
1k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Pragmatic Product Professional
lauravandoore
33
6.6k
How STYLIGHT went responsive
nonsquared
100
5.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
RailsConf 2023
tenderlove
30
1.1k
Build your cross-platform service in a week with App Engine
jlugia
230
18k
Designing for humans not robots
tammielis
253
25k
What's in a price? How to price your products and services
michaelherold
245
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
560
Facilitating Awesome Meetings
lara
54
6.3k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
Making the Leap to Tech Lead
cromwellryan
133
9.3k
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!