Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
46
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
44
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
42
Serverless Concepts
kellyjandrews
1
200
Other Decks in Technology
See All in Technology
特別捜査官等研修会
nomizone
0
560
AWSの新機能をフル活用した「re:Inventエージェント」開発秘話
minorun365
2
440
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
150
2025-12-27 Claude CodeでPRレビュー対応を効率化する@機械学習社会実装勉強会第54回
nakamasato
0
200
Introduce marp-ai-slide-generator
itarutomy
0
110
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
3
3k
「図面」から「法則」へ 〜メタ視点で読み解く現代のソフトウェアアーキテクチャ〜
scova0731
0
490
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
320
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
120
AR Guitar: Expanding Guitar Performance from a Live House to Urban Space
ekito_station
0
150
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
500
20251203_AIxIoTビジネス共創ラボ_第4回勉強会_BP山崎.pdf
iotcomjpadmin
0
130
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.3k
Believing is Seeing
oripsolob
0
15
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
65
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
300
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
45
WCS-LA-2024
lcolladotor
0
390
Marketing to machines
jonoalderson
1
4.3k
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