Why are Docker container images so large?

前端 未结 8 1919
被撕碎了的回忆
被撕碎了的回忆 2020-11-30 17:32

I made a simple image through Dockerfile from Fedora (initially 320 MB).

Added Nano (this tiny editor of 1MB size), and the size of the image has risen to 530 MB. I\

8条回答
  •  爱一瞬间的悲伤
    2020-11-30 17:41

    Docker Squash is a really nice solution to this. you can $packagemanager clean in the last step instead of in every line and then just run a docker squash to get rid of all of the layers.

    https://github.com/jwilder/docker-squash

提交回复
热议问题