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
0
47
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
45
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
43
Serverless Concepts
kellyjandrews
1
200
Other Decks in Technology
See All in Technology
SwiftDataを覗き見る
akidon0000
0
270
迷わない!AI×MCP連携のリファレンスアーキテクチャ完全ガイド
cdataj
0
570
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
First-Principles-of-Scrum
hiranabe
4
2.3k
GitHub Copilot CLI 現状確認会議
torumakabe
8
1.6k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Qiita Bash アドカレ LT #1
okaru
0
190
「アウトプット脳からユーザー価値脳へ」がそんなに簡単にできたら苦労しない #RSGT2026
aki_iinuma
11
5.5k
I tried making a solo advent calendar!
zzzzico
0
150
「リリースファースト」の実感を届けるには 〜停滞するチームに変化を起こすアプローチ〜 #RSGT2026
kintotechdev
0
1.1k
コミュニティが持つ「学びと成長の場」としての作用 / RSGT2026
ama_ch
2
340
みんなでAI上手ピーポーになろう! / Let’s All Get AI-Savvy!
kaminashi
0
150
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
47
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Utilizing Notion as your number one productivity tool
mfonobong
2
200
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.8k
Balancing Empowerment & Direction
lara
5
840
YesSQL, Process and Tooling at Scale
rocio
174
15k
BBQ
matthewcrist
89
10k
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