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
18
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
100
Docker: Development to Production
kellyjandrews
0
20
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
18
Serverless Concepts
kellyjandrews
1
160
Other Decks in Technology
See All in Technology
VSCode上からSlackにメッセージを送る拡張機能を作っている話
ebarakazuhiro
0
120
中学生でもわかる深層学習
e869120
7
1.2k
エバンジェリスト活動を7年やってきて見えてきた、コミュニティとエバンジェリストの関係
soracom
PRO
1
200
20240321_生成AI時代のDevOps
kzkmaeda
2
610
イチから学ぶdbt / Learn dbt from scratch
shinyaa31
0
130
ビジネスロジックを「型」で表現するOOPのための関数型DDD / Functional And Type-Safe DDD for OOP
yuitosato
29
12k
データマネジメントを支える武器としてのメタデータ管理
10xinc
2
810
あらゆる商品を扱う商品データベースを再設計した話 / product db re-architecture
rince
8
3.8k
技育祭2024春 LT Finatextホールディングス
kevinrobot34
1
170
Oracle Database で機械学習を始めよう! Oracle Machine Learning
oracle4engineer
PRO
1
140
Elementaryを用いたデータ品質の可視化とデータ基盤の運用改善
10xinc
6
1.6k
AMLD 2024 - Build Your Own GPT
donlelef
1
260
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.3k
Bash Introduction
62gerente
604
210k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
28
5.9k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
178
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
14
1.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.2k
In The Pink: A Labor of Love
frogandcode
137
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
950
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.4k
Faster Mobile Websites
deanohume
296
30k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Ruby is Unlike a Banana
tanoku
95
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