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
Tips for Building Lightweight Docker Images
Search
Kelly Andrews
July 21, 2017
Technology
56
0
Share
Tips for Building Lightweight Docker Images
Kelly Andrews
July 21, 2017
More Decks by Kelly Andrews
See All by Kelly Andrews
Communications on Fire
kellyjandrews
0
130
Docker: Development to Production
kellyjandrews
0
51
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
50
Serverless Concepts
kellyjandrews
1
210
Other Decks in Technology
See All in Technology
AIエージェントの支払い基盤 AgentCore Payments概要
kmiya84377
1
150
100マイクロサービスのTerraform/Kubernetes管理地獄から抜け出すためのAI活用術
markie1009
0
110
Sociotechnical Architecture Reviews: Understanding Teams, not just Artefacts
ewolff
1
160
鹿野さんに聞く!CSSの最新トレンド Ver.2026
tonkotsuboy_com
6
2.7k
20260513_生成AIを専属DSに_AI分析結果の検品テクニック_ハンズオン_交通事故データ
doradora09
PRO
0
210
拝啓、あの夏の僕へ〜あなたも知っているApp Runnerの世界〜
news_it_enj
0
230
要件定義の精度を高めるための型と生成AIの活用 / Using Types and Generative AI to Improve the Accuracy of Requirements Definition
haru860
0
310
Purview 勉強会報告 Microsoft Purview 入門しようとしてみた
masakichixo
1
200
CyberAgent YJC Connect
shimaf4979
1
170
サンプリングは「作る」のか「使う」のか? 分散トレースのコストと運用を両立する実践的戦略 / Why you need the tail sampling and why you don't want it
ymotongpoo
3
150
Oracle Cloud Infrastructure presents managed, serverless MCP Servers for Oracle AI Database
thatjeffsmith
0
200
カオナビに Suspenseを導入するまで / The Road to Suspense at kaonavi
kaonavi
1
440
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
210
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
780
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
240
The Cult of Friendly URLs
andyhume
79
6.9k
ラッコキーワード サービス紹介資料
rakko
1
3.2M
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
@kellyjandrews Tips for Building Lightweight Docker Images Kelly J Andrews
- Developer Advocate, Codeship
@kellyjandrews Docker Images
@kellyjandrews Docker Images
@kellyjandrews Docker Images What is a docker image
@kellyjandrews Docker Images A Docker image is built up from
a series of layers. Each layer represents an instruction in the image’s Dockerfile. Each layer except the very last one is read-only. Source: docker.com
@kellyjandrews Docker Images FROM ubuntu:15.04 COPY . /app RUN make
/app CMD python /app/app.py
@kellyjandrews Docker Images Source: docker.com
@kellyjandrews Docker Images Source: docker.com
@kellyjandrews Smaller = Better
@kellyjandrews Smaller is Better Large Images = Longer Download Times
Node Latest - 84 sec. Wheezy - 63 sec. Slim - 13 sec. Alpine - 12 sec.
@kellyjandrews Smaller is Better Large Images = More Disk Space
Node Latest 667 MB Wheezy 522 MB Slim 226 MB Alpine 64.7 MB
@kellyjandrews Smaller is Better Large Images = Unused Programs Node
Latest - 786 Wheezy - 719 Slim - 496 Alpine - 329
@kellyjandrews Docker Dieting Tips
@kellyjandrews Docker Dieting Tips Best Practices for Building Minimal Docker
Images https://resources.codeship.com/ebooks
@kellyjandrews Docker Dieting Tips Use Fewer Layers RUN apt-get update
-y RUN apt-get install -y curl RUN apt-get install -y postgresql RUN apt-get install -y postgresql-client
@kellyjandrews Docker Dieting Tips Use Fewer Layers RUN apt-get update
-y && \ apt-get install -y curl postgresql postgresql-client
@kellyjandrews Docker Dieting Tips Clean Up After Yourself RUN apt-get
update -y && \ apt-get install -y curl postgresql postgresql-client && \ rm -rf /var/lib/apt/lists/*
@kellyjandrews Docker Dieting Tips Base Images Node Latest 667 MB
Wheezy 522 MB Slim 226 MB Alpine 64.7 MB
@kellyjandrews Docker Dieting Tips Optimize Dockerignore File root # ls
mycode tmp logs $ echo “tmp” >> .dockerignore $ echo “logs” >> .dockerignore
@kellyjandrews Docker Dieting Tips Jessie Frazelle github.com/jessfraz/dockerfiles