我知道Docker -- cache -from命令会在构建不同的镜像时从拉取的镜像中恢复缓存。我说错了吗?每当我创建一个新的镜像,删除它和它的悬空缓存,拉取它并重新构建它,它将不会使用新下载的镜像作为缓存。下面是我的用例的命令。
docker build --target base -t image:base .
docker push image:base
docker image rm image:base
docker builder prune
docker pull image:base
docker build --target base --cache-from image:base -t image:base .如果我不修剪缓存,它将使用它,而不管-- cache -from命令是否存在。因此,我应该如何使用-- cache - from,有没有可能在不使用docker load的情况下从拉取的图像中恢复缓存(因为这需要一段时间)?
发布于 2021-09-28 10:38:33
https://stackoverflow.com/questions/69359842
复制相似问题