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
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
720
Programação também é mágica
abdala
0
170
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
110
PHPUnit, ele irá te salvar!
abdala
0
100
Presente! Software Livre
abdala
0
81
Other Decks in Technology
See All in Technology
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
21
6.7k
やさしいA2A入門
minorun365
PRO
12
1.8k
Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU / amazon-bedrock-agentcore-workshop-jawsug-tohoku-2026
gawa
9
750
AWSシリコン最前線 〜AI時代のチップ選択を読み解く〜
htokoyo
2
520
AAIFに入ってみた ~内から見えるコミュニティ動向~
sato4
0
180
200個のGitHubリポジトリを横断調査したかった
icck
0
120
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
610
EventBridge Connection
_kensh
5
700
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
0
2.1k
On-behalf-of Token exchange with AgentCore Identity
hironobuiga
2
150
AIはどのように 組織のアジリティを変えるのか?
junki
1
540
How Timee Delivers Day 1 Production Ready LLM Features
tomoyks
0
150
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
The Invisible Side of Design
smashingmag
302
52k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
My Coaching Mixtape
mlcsv
0
140
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
The Curious Case for Waylosing
cassininazir
1
380
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!