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
350
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
600
Programação também é mágica
abdala
0
140
Websockets e você, tudo a ver
abdala
1
120
PHP em todos os lugares
abdala
1
120
Automatizado rotinas com sua linguagem favorita
abdala
0
90
PHPUnit, ele irá te salvar!
abdala
0
75
Presente! Software Livre
abdala
0
59
Other Decks in Technology
See All in Technology
Raycast AI APIを使ってちょっと便利な拡張機能を作ってみた / created-a-handy-extension-using-the-raycast-ai-api
kawamataryo
0
100
組織貢献をするフリーランスエンジニアという生き方
n_takehata
2
1.3k
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
980
Building Products in the LLM Era
ymatsuwitter
10
5.6k
Developer Summit 2025 [14-D-1] Yuki Hattori
yuhattor
19
6.3k
Data-centric AI入門第6章:Data-centric AIの実践例
x_ttyszk
1
410
次世代KYC活動報告 / 20250219-BizDay17-KYC-nextgen
oidfj
0
260
Developers Summit 2025 浅野卓也(13-B-7 LegalOn Technologies)
legalontechnologies
PRO
1
740
2025-02-21 ゆるSRE勉強会 Enhancing SRE Using AI
yoshiiryo1
1
380
AndroidXR 開発ツールごとの できることできないこと
donabe3
0
130
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
200
Culture Deck
optfit
0
430
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Optimizing for Happiness
mojombo
376
70k
A designer walks into a library…
pauljervisheath
205
24k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Documentation Writing (for coders)
carmenintech
67
4.6k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.8k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
330
Faster Mobile Websites
deanohume
306
31k
The Cost Of JavaScript in 2023
addyosmani
47
7.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!