我希望创建一个包含几项自定义的Docker镜像。我有一个大小为16GB的现有镜像,并将其作为容器启动。现在,我已经从容器中删除了所有不必要的文件,并将其提交为新镜像。但是新镜像仍然显示为16GB。实际上,新镜像应该只有大约1GB的大小。
如何从正在运行的容器中创建一个新的小型镜像? 所遵循的步骤:
1) launched a container from the 16GB image
2) deleted unwanted files from the container
3) committed new image from the container
谢谢 Sarath。