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
38
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
36
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
37
Serverless Concepts
kellyjandrews
1
190
Other Decks in Technology
See All in Technology
会社もクラウドも違うけど 通じたコスト削減テクニック/Cost optimization strategies effective regardless of company or cloud provider
aeonpeople
2
170
P2P ではじめる WebRTC のつまづきどころ
tnoho
1
220
PHPでResult型やってみよう
higaki_program
0
190
公開初日に個人環境で試した Gemini CLI 体験記など / Gemini CLI実験レポート
you
PRO
3
360
With Devin -AIの自律とメンバーの自立
kotanin0
2
110
RapidPen: AIエージェントによる高度なペネトレーションテスト自動化の研究開発
laysakura
1
390
TypeScript 上達の道
ysknsid25
14
2.4k
P2P通信の標準化 WebRTCを知ろう
faithandbrave
6
2.3k
AI工学特論: MLOps・継続的評価
asei
10
1.6k
経験がないことを言い訳にしない、 AI時代の他領域への染み出し方
parayama0625
0
170
2025/07/22_家族アルバム みてねのCRE における生成AI活用事例
masartz
2
110
AI Ready API ─ AI時代に求められるAPI設計とは?/ AI-Ready API - Designing MCP and APIs in the AI Era
yokawasa
21
5.8k
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Thoughts on Productivity
jonyablonski
69
4.7k
Bash Introduction
62gerente
613
210k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
KATA
mclloyd
30
14k
Building Adaptive Systems
keathley
43
2.7k
4 Signs Your Business is Dying
shpigford
184
22k
Designing for humans not robots
tammielis
253
25k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.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