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
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
Gemini でコードレビュー知見を見える化
zozotech
PRO
1
220
因果AIへの招待
sshimizu2006
0
930
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
1
360
AWSを使う上で最低限知っておきたいセキュリティ研修を社内で実施した話 ~みんなでやるセキュリティ~
maimyyym
2
190
プロダクトマネージャーが押さえておくべき、ソフトウェア資産とAIエージェント投資効果 / pmconf2025
i35_267
2
590
グレートファイアウォールを自宅に建てよう
ctes091x
0
140
エンジニアリングをやめたくないので問い続ける
estie
0
110
AI 駆動開発勉強会 フロントエンド支部 #1 w/あずもば
1ftseabass
PRO
0
220
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
430
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
2
830
AI時代の開発フローとともに気を付けたいこと
kkamegawa
0
2.3k
[CMU-DB-2025FALL] Apache Fluss - A Streaming Storage for Real-Time Lakehouse
jark
0
110
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
RailsConf 2023
tenderlove
30
1.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
A Tale of Four Properties
chriscoyier
162
23k
Done Done
chrislema
186
16k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Practical Orchestrator
shlominoach
190
11k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Bash Introduction
62gerente
615
210k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.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