Docker镜像瘦身 发表于 2021-08-09 分类于 运维测试 本文字数: 712 阅读时长 ≈ 1 分钟 介绍 使用docker-slim来给docker镜像瘦身 安装12docker pull dslim/docker-slimbrew install docker-slim 使用12345docker-slim build --from-dockerfile build/docker/Dockerfile --tag lukelau/laumonkey:release-8-g95cdcb3 .# docker-slim build --helpdocker-slim build --from-dockerfile build/docker/Dockerfile --tag lukelau/laumonkey:release-8-g95cdcb3 .docker-slim build --target ccr.ccs.tencentyun.com/zsyltest/edu:frontend_20210818104832 --tag frontend:test --http-probe=false2be29257fafc 注意事项1234--include-path参数的使用Docker-Slim默认压缩会把镜像里面的一些核心文件、文件夹删掉,会导致压缩后的镜像在容器中运行时报错,用--include-path参数可以解决该问题,保护路径不被剔除# 示例docker-slim build --http-probe=false --include-path=/var/lib/mysql-files --include-path=/var/run/mysqld mysql:5.7 -------------本文结束感谢您的阅读------------- Related Posts By Tag 资源网站 Python在docker中调试 部署事故 Sql技巧 第三方库的版本异常