Open monkeyWie opened 1 year ago
What's the command you're using to build the image?
Can you reproduce, or was this a one-off failure?
Hi @jedevc, the build command being used is DOCKER_BUILDKIT=1 docker build -t app-dev:latest .
, and it seems that the issue is being replicated almost every time. From my perspective, the initial steps of the build process should use the cache, so network requests shouldn't really be necessary.
I believe this issue is same or related with the following;
and probably a few more... and it is there for a few (3-5) years now. It happens on Apline Linux and MacOS(alpine/docker on lima) for me.
trying to load metadata remotely for a locally available image for no apparent reason, each time. I expect absolutely ZERO network ops if the image is built once and all parts available locally.
for some reason, only this "load metadata" problem is much slower than the consecutive operations. probably due to network/dns issues.
I could not find any way to disable remote metadata lookups.. trying to read related code;
None of the following is a good solution
FROM
images locally => [php-fpm internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.30kB 0.0s
=> [php-fpm internal] load metadata for docker.io/library/alpine:3.14 0.0s <= Ok…
=> [php-fpm internal] load metadata for docker.io/library/composer:2.2.23 30.5s <=== !!!
=> [php-fpm internal] load .dockerignore 0.0s
=> => transferring context: 189B 0.0s
$ docker --version Docker version 26.1.3, build b72abbb
The systems is a VM in a datacenter. On a 10G link with lightning fast DNS responses.
Following the advice in https://stackoverflow.com/a/70483395/1449366 and just pulled the problematic images manually.
From now on, the builds are lightning fast. (And no, I did not re-tag them, just did docker pull …
.)
I enabled BUILDKIT, after a successful build image, the first step of building again does not use caching and is very slow. resolve image config takes
70
seconds!console
Dockerfile
docker version