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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kelly Andrews
July 21, 2017
Technology
58
0
Share
Tips for Building Lightweight Docker Images
Kelly Andrews
July 21, 2017
More Decks by Kelly Andrews
See All by Kelly Andrews
Communications on Fire
kellyjandrews
0
130
Docker: Development to Production
kellyjandrews
0
51
Continuous Testing, Integration, and Deployment for JavaScript Projects
kellyjandrews
0
50
Serverless Concepts
kellyjandrews
1
210
Other Decks in Technology
See All in Technology
AIが変えた"品質の守り方"
kkakizaki
13
5.4k
オンコールの負荷軽減のためのBits Assistant 活用方法 / How to Use Bits Assistant to Reduce the Workload on On-Call Staff
sms_tech
1
350
大規模災害時でも高い信頼性を維持するアプリケーション基盤の実現/nikkei-tech-talk46
nikkei_engineer_recruiting
0
120
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
610
OpenClawとHermesAgentでAI新入社員を作った話
takanoriyanada
0
150
先取りMaven4 ~16年ぶりのメジャーアップデート、その進化とは?~
ogiwarat
0
110
Java正規表現エンジン(NFA)の仕組みと パフォーマンスを維持するための最適化手法
takeuchi_132917
0
160
Spring Boot における AOT Cache 活用テクニックと 起動時間改善事例
ntt_dsol_java
0
180
AI時代から振り返るTerraform drift運用の歴史 / AI Age Reflections on the History of Terraform Drift Operations
aeonpeople
0
610
Amazon Bedrock 経由の Claude Cowork を試してみよう・MCP にも繋いでみよう
sugimomoto
0
270
AI駆動開発でなんでもハンズオン環境をつくってみた
yoshimi0227
0
180
ルールやカスタム機能、どう使う?理想の出力を引き出すために今知りたいIBM Bob 5つの機能
muehara
0
150
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
0
8.1k
Ethics towards AI in product and experience design
skipperchong
2
290
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
160
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
240
Claude Code のすすめ
schroneko
67
220k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
The Curious Case for Waylosing
cassininazir
1
360
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
590
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
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