docker提交后image过大
过去多啦不再A梦
过去多啦不再A梦 2017-04-27 09:02:07
0
3
777

我在使用docker构建LNMP环境时,我用docker获取了centos的镜像,然后在centos里构建LNMP的环境,我安装完mysql之后进行了一次commit,完成之后镜像大小时282M,然后我又重新进入yum install了php,完成之后commit了一下,镜像大小就变为了659M,为什么会这样,增长为什么会这么大?

过去多啦不再A梦
过去多啦不再A梦

reply all(3)
PHPzhong

When installing a program through yum, many temporary files will be generated, and many software packages that are not necessarily needed will be installed as recommended software, so the image will naturally become larger.

In addition, it is best not to run all programs in one container, but to build services through container orchestration.

世界只因有你

You are using the docker container as a virtual machine. This is incorrect usage. You should use Dockerfile to make the image and follow the best principles for writing Dockerfile.
For lnmp’s Docker container production, please refer to https://www.centos.bz/2017/02...

曾经蜡笔没有小新

You made the image based on the centos system image, which is equivalent to bundling several images together, so it becomes larger. One program has one image, and then communicates, so it will not be too big.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!