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
49
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
47
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
44
Serverless Concepts
kellyjandrews
1
200
Other Decks in Technology
See All in Technology
技術キャッチアップ効率化を実現する記事推薦システムの構築
yudai00
2
160
OCI技術資料 : 外部接続 VPN接続 詳細
ocise
1
10k
APMの世界から見るOpenTelemetryのTraceの世界 / OpenTelemetry in the Java
soudai
PRO
0
200
AI が Approve する開発フロー / How AI Reviewers Accelerate Our Development
zaimy
1
230
トラブルの大半は「言ってない」x「言ってない」じゃねーか!!
ichimichi
0
200
競争優位を生み出す戦略的内製開発の実践技法
masuda220
PRO
2
500
組織のSREを推進するためのPlatform EngineeringとEKS / Platform Engineering and EKS to drive SRE in your organization
chmikata
0
150
AIで 浮いた時間で 何をする? 2026春 #devsumi
konifar
16
3.4k
primeNumber DATA MANAGEMENT CAMP #2:
masatoshi0205
1
620
Introduction to Bill One Development Engineer
sansan33
PRO
0
370
男(監査)はつらいよ - Policy as CodeからAIエージェントへ
ken5scal
4
630
バクラクにおける Document Understanding の挑戦:書類の「読取」から「意思決定」へ / document-understanding-in-bakuraku-2026
yuya4
0
150
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
160
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
130
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Writing Fast Ruby
sferik
630
62k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
RailsConf 2023
tenderlove
30
1.4k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
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