3 ms·
Does anyone know how to skip/bypass the "load metadata for docker.io/" step on a build? I already have the image cached but it fails on that step regardless.
by hipadev23 2y ago
Does anyone know how to skip/bypass the "load metadata for docker.io/" step on a build? I already have the image cached but it fails on that step regardless.
- shykes 2y agoIf you specify the image digest in the image address, buildkit (the low-level implementation of docker build) will skip the metadata lookup. For example: FROM nginx:1.21.6@sha256:ec5c36ef5a2c29cf90d5b59c5f9f90272b472c604983b474b201bc2bfa123e6f
- hipadev23 2y agoyou rock, thank you.
- mhio 2y agodocker build --pull=false ...
- hipadev23 2y agoit’s not the pull, it’s a metadata check
- mhio 2y agoThe metadata check is part of the builds image pull process. The step can resolve a `FROM repo/image:tag` reference to the content sha the tag points to, and then if required fetch the content. In any case, recent-ish (maybe 24+) versions of docker default to a "prefer local" mode in buildkit so a local cached entry will be returned first if possible before any remotes are resolved. Out of interest, what docker/buildx/buildkit versions were attempting the connection? We ran into this on some container builds that run offline last year some time and I'm wondering if it was due to some ancient docker, as that flag appears useless on current docker. - https://github.com/docker/buildx/blob/7b1ec7211d871dfba53b10f0c7cf846022665aa5/build/opt.go#L282-L287 https://github.com/docker/buildx/blob/7b1ec7211d871dfba53b10...
- hipadev23 2y agodocker build --pull=false . still does a metadata check for me every single time. If i add the @sha256: like the sibling comment suggested, it does not. Docker 26.1.4