2020年8月27日星期四

Docker: How To Make A Docker Image Smaller

 Tips to Reduce Docker Image Sizes

Tip #1 — Use a smaller base image. FROM ubuntu. ...
Tip #2 — Don't install debug tools like vim/curl. ...
Tip #3 — Minimize Layers. ...
Tip #4 Use — no-install-recommends on apt-get install. ...
Tip #5 Add rm -rf /var/lib/apt/lists/* to same layer as apt-get installs. ...
Tip #6 Use FromLatest.io.

==============================================

Tip #1 — Use a smaller base image. FROM ubuntu. ...
Size Of  ubuntu Base Image maybe above 125MB.
Consider using an alpine base image (only 5MB in size).


Tip #2 — Don't install debug tools like vim/curl. ...
Tip #3 — Minimize Layers. ...
Tip #4 Use — no-install-recommends on apt-get install. ...
Tip #5 Add rm -rf /var/lib/apt/lists/* to same layer as apt-get installs. ...
Tip #6 Use FromLatest.io.  

没有评论: