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
610
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
61
Other Decks in Technology
See All in Technology
20250413_湘南kaggler会_音声認識で使うのってメルス・・・なんだっけ?
sugupoko
1
480
Spring Bootで実装とインフラをこれでもかと分離するための試み
shintanimoto
7
810
SREからゼロイチプロダクト開発へ ー越境する打席の立ち方と期待への応え方ー / Product Engineering Night #8
itkq
2
570
彩の国で始めよう。おっさんエンジニアから共有したい、当たり前のことを当たり前にする技術
otsuki
0
140
はてなの開発20年史と DevOpsの歩み / DevOpsDays Tokyo 2025 Keynote
daiksy
6
1.5k
The Tale of Leo: Brave Lion and Curious Little Bug
canalun
1
120
Dynamic Reteaming And Self Organization
miholovesq
3
440
Goの組織でバックエンドTypeScriptを採用してどうだったか / How was adopting backend TypeScript in a Golang company
kaminashi
6
5.3k
アセスメントで紐解く、10Xのデータマネジメントの軌跡
10xinc
1
430
4/16/25 - SFJug - Java meets AI: Build LLM-Powered Apps with LangChain4j
edeandrea
PRO
1
100
watsonx.data上のベクトル・データベース Milvusを見てみよう/20250418-milvus-dojo
mayumihirano
0
110
SDカードフォレンジック
su3158
1
600
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
Rails Girls Zürich Keynote
gr2m
94
13k
GraphQLとの向き合い方2022年版
quramy
46
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
23
2.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
660
Bash Introduction
62gerente
611
210k
RailsConf 2023
tenderlove
30
1.1k
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!