如何使docker层到单层

Docker镜像创build多层,我想将其转换为单层有没有任何dockerbuild立命令来实现这个? 我googlesearch,但无法find任何东西

没有命令来实现这一点,单层图像是反对docker的devise理念。 了解图像,容器和存储驱动程序doc描述了为什么docker图像具有多个图层。 总之,图像层are one of the reasons Docker is so lightweight. When you change a Docker image, such as when you update an application to a new version, a new layer is built and replaces only the layer it updates. are one of the reasons Docker is so lightweight. When you change a Docker image, such as when you update an application to a new version, a new layer is built and replaces only the layer it updates. 此外,即使你的图像只有一个图层,当你创build一个包含该图像的容器时,docker仍然会在图像图层的顶部添加一个精简的Read / Writable容器图层。

如果你只是想移动你的图像,并认为单层可以使它更容易,你可能应该尝试使用docker save命令来创build它的tar文件。

或者您有更复杂的要求,您可能需要使用虚拟机映像而不是泊坞窗映像。