如何打造更小巧的容器镜像

  发布时间:2025-11-05 06:16:46   作者:玩站小弟   我要评论
复制#Dockerfilewith cacheFROM fedora:28LABEL maintainer ChrisCollins<collins.christopher@gmail.com& 。
如何打造更小巧的容器镜像
何打复制#Dockerfilewith cacheFROM fedora:28LABEL maintainer ChrisCollins<collins.christopher@gmail.com>RUN dnf install -y nginx-----#Dockerfilew/o cacheFROM fedora:28LABEL maintainer ChrisCollins<collins.christopher@gmail.com>RUN dnf install -y nginx \&& dnf clean all \&&rm-rf /var/cache/yum-----[chris@krang] $ docker build -t cache -f Dockerfile.[chris@krang] $ docker images --format "{{.Repository}}: {{.Size}}"|head-n 1cache:464 MB[chris@krang] $ docker build -t no-cache -f Dockerfile-wo-cache .[chris@krang] $ docker images --format "{{.Repository}}: {{.Size}}"|head-n 1no-cache:271 MB1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.
  • Tag:

相关文章

最新评论