是否可以将这一行RUN apt-get update && apt-get install -y暂时缓存在Dockerfile中?
原因是在对Dockerfile进行故障排除时,我会多次重新生成图像,这一行的等待时间最长。
发布于 2021-02-10 01:36:46
是的,有可能。
从您的停靠文件中创建停靠者图像。将文件分离到2个Dockerfile,第一个是FROM和RUN apt-get update && apt-get install -y,第二个是其他指令
cd /dir/with/Dockerfile映像构建-t my-fast。
生成后在第二个Dockerfile中使用图像
我的快速码头的
:最新的
https://stackoverflow.com/questions/66129576
复制相似问题