当构建一个引用未缓存的图像的 Dockerfile时,以及使用;mirror.gcr.io
启用时 DOCKER_BUILDKIT=1
构建失败:
$ cat Dockerfile.test
FROM debian:10
$ sudo cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://mirror.gcr.io"]
}
$ DOCKER_BUILDKIT=1 docker build -f Dockerfile.test .
[+] Building 1.0s (4/4) FINISHED
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile.test 0.0s
=> => transferring dockerfile: 42B 0.0s
=> ERROR [internal] load metadata for docker.io/library/debian:10 0.6s
=> ERROR [1/1] FROM docker.io/library/debian:10 0.3s
=> => resolve docker.io/library/debian:10 0.3s
------
> [internal] load metadata for docker.io/library/debian:10:
------
------
> [1/1] FROM docker.io/library/debian:10:
------
failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: docker.io/library/debian:10 not found