Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
0
44
Tips for Building Lightweight Docker Images
Kelly Andrews
July 21, 2017
Tweet
Share
More Decks by Kelly Andrews
See All by Kelly Andrews
Communications on Fire
kellyjandrews
0
120
Docker: Development to Production
kellyjandrews
0
43
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
41
Serverless Concepts
kellyjandrews
1
190
Other Decks in Technology
See All in Technology
【AWS re:Invent 2025速報】AIビルダー向けアップデートをまとめて解説!
minorun365
4
480
Challenging Hardware Contests with Zephyr and Lessons Learned
iotengineer22
0
130
Edge AI Performance on Zephyr Pico vs. Pico 2
iotengineer22
0
110
日本Rubyの会の構造と実行とあと何か / hokurikurk01
takahashim
4
960
Uncertainty in the LLM era - Science, more than scale
gaelvaroquaux
0
810
MapKitとオープンデータで実現する地図情報の拡張と可視化
zozotech
PRO
1
120
GitHub Copilotを使いこなす 実例に学ぶAIコーディング活用術
74th
3
1.7k
【pmconf2025】PdMの「責任感」がチームを弱くする?「分業型」から全員がユーザー価値に本気で向き合う「共創型開発チーム」への変遷
toshimasa012345
0
280
形式手法特論:CEGAR を用いたモデル検査の状態空間削減 #kernelvm / Kernel VM Study Hokuriku Part 8
ytaka23
2
450
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
1
410
EM歴1年10ヶ月のぼくがぶち当たった苦悩とこれからへ向けて
maaaato
0
270
生成AIでテスト設計はどこまでできる? 「テスト粒度」を操るテーラリング術
shota_kusaba
0
570
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Designing for humans not robots
tammielis
254
26k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Into the Great Unknown - MozCon
thekraken
40
2.2k
A Tale of Four Properties
chriscoyier
162
23k
Site-Speed That Sticks
csswizardry
13
990
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Designing for Performance
lara
610
69k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
4 Signs Your Business is Dying
shpigford
186
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