According to the Docker documentation,docker build应缓存所有未更改的行。Dockerfile不一致缓存
问题是,即使我没有更改我的Dockerfile或仅更改它的结尾,图像也会从Dockerfile的起始位置或随机位置中重建。其他时候缓存按预期工作。我没有ADD
命令。
我使用的建设我的形象的命令是docker build --tag=pineapple/orange .
输出开始了,像这样:
Step 1 : FROM centos:7
---> 0f0be3675ebb
Step 2 : MAINTAINER Dixie Chicks <[email protected]>
---> Using cache
---> 7669f54fc137
Step 3 : RUN yum update && yum install -y epel-release && yum install -y wget git python-devel && wget "https://bootstrap.pypa.io/get-pip.py" && python get-pip.py
---> Running in 92a8f1cff2db
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
* base: centos.den.host-engine.com
* extras: centos-mirror.jchost.net
* updates: centos.chicago.waneq.com
... [starts re-installing everything]
是否构建缓存不明确的标签工作?我可以使用什么策略来弄清楚为什么会发生这种情况?
编辑:如果它有所不同,我一直在编辑PyCharm内的Dockerfile。
我只看到一次运行。不一致意味着什么? –