Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Docker: multi-stage multi-environment
Search
Abdala Cerqueira
August 31, 2018
Technology
400
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
Transcript
16 slides
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!
More Decks by Abdala Cerqueira
See All by Abdala Cerqueira
Docker: multi-stage and multi-environment
abdala
3
750
Programação também é mágica
abdala
0
180
Websockets e você, tudo a ver
abdala
1
150
PHP em todos os lugares
abdala
1
160
Automatizado rotinas com sua linguagem favorita
abdala
0
120
PHPUnit, ele irá te salvar!
abdala
0
120
Presente! Software Livre
abdala
0
90
Other Decks in Technology
See All in Technology
メルカリの小規模チーム「Pod」で、 エンジニアがデータアナリストなしで、 AIを使ってデータ分析の自走を目指す取り組み
jackojacko_
0
240
OpenTelemetryで変わった 新時代のCloudWatchメトリクス監視
tsukuboshi
0
460
re:Inventを楽しむために、 1日1つ「これが楽しみ」を決めよう
beli68
0
120
変更差分を読むために環境を整備しよう
pipepasta
1
480
これからのデータエンジニアの役割について考える / Rethinking the Role of Data Engineers in the AI Era
okiyuki99
1
540
未来を描き変化の中で学び直す ヴァンガードから考える、AI時代のチーム開発
lamb_moko
0
110
サーバーラックは作る時代! 3Dプリンターで作る10インチラックのススメ
jacopen
2
480
文書画像からの情報抽出を行うエージェントを、軌跡の正解データ無しで作れるか
sansantech
PRO
2
220
共通基盤の実装に Kotlin - Quarkus を選定した理由と採用したアーキテクチャ
nealle
1
150
IoTのデータ保存をSREの観点で考える
grimoh
1
110
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
2
1.1k
Linuxネットワークスタック進化の軌跡: 過去10年の歩みと最新トレンド
orimanabu
4
760
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
620
How to make the Groovebox
asonas
2
2.6k
Google's AI Overviews - The New Search
badams
0
1.7k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530
Building Adaptive Systems
keathley
44
3.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Practical Orchestrator
shlominoach
192
12k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Paper Plane
katiecoart
PRO
6
55k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
430
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
The SEO Collaboration Effect
kristinabergwall1
1
620