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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Abdala Cerqueira
August 31, 2018
Technology
390
0
Share
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
700
Programação também é mágica
abdala
0
170
Websockets e você, tudo a ver
abdala
1
130
PHP em todos os lugares
abdala
1
140
Automatizado rotinas com sua linguagem favorita
abdala
0
100
PHPUnit, ele irá te salvar!
abdala
0
96
Presente! Software Livre
abdala
0
77
Other Decks in Technology
See All in Technology
20260410 - CNTUG meetup #72 - DiskImage Builder 介紹:以 Kubespray CI 打造 RockyLinux 10 Cloud Image 為例
tico88612
0
120
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.1k
建設的な現実逃避のしかた / How to practice constructive escapism
pauli
4
320
BIツール「Omni」の紹介 @Snowflake中部UG
sagara
0
270
プロダクトを触って語って理解する、チーム横断バグバッシュのすすめ / 20260411 Naoki Takahashi
shift_evolve
PRO
1
270
さくらのクラウドでつくるCloudNative Daysのオブザーバビリティ基盤
b1gb4by
0
160
会社紹介資料 / Sansan Company Profile
sansan33
PRO
16
410k
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
380
AI環境整備はどのくらい開発生産性を変えうるか? #AI駆動開発 #AI自走環境
ucchi0909
0
120
Zero-Downtime Migration: Moving a Massive, Historic iOS App from CocoaPods to SPM and Tuist without Stopping Feature Delivery
kagemiku
0
230
暗黙知について一歩踏み込んで考える - 暗黙知の4タイプと暗黙考・暗黙動へ
masayamoriofficial
0
1.4k
60分で学ぶ最新Webフロントエンド
mizdra
PRO
24
12k
Featured
See All Featured
Abbi's Birthday
coloredviolet
2
6.5k
How STYLIGHT went responsive
nonsquared
100
6k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
Code Review Best Practice
trishagee
74
20k
Deep Space Network (abreviated)
tonyrice
0
110
WCS-LA-2024
lcolladotor
0
520
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
480
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Typedesign – Prime Four
hannesfritz
42
3k
So, you think you're a good person
axbom
PRO
2
2k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
310
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!