You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BuildKit builds are not cached enough to allow offline no-op builds #738
Reacted by Pedro Augusto de Paula Barbosa, Robin, Thomas DA ROCHA, dsech, Benny Lutati, pwlodarczyk92, Gniang, JonZeolla, Dimitri Kadashev and vegas503
You need to define your build dependencies locally, eg. for alpine:latest your need to docker pull alpine:latest or your need to define them with immutable digests. Otherwise builder needs to check if the latest tag has been updated or not.
You need to define your build dependencies locally, eg. for alpine:latest your need to docker pull alpine:latest or your need to define them with immutable digests. Otherwise builder needs to check if the latest tag has been updated or not.
Look at the detailed repro; apparently it does not need to check that if a non-BuildKit build has completed locally.
It might be that the non-BuildKit build implicitly pulls the image (as in docker pull alpine:latest), while the BuildKit build intentionally does not, so that at every build it is fetched again.
Usually I would expect the image to be pulled at the first build (and at every build if the --pull flag is specified).
A checksum is only valid for one platform, so using a checksum tag won't work. However, I'm not sure how many people really need multi-platform builds offline? As far as I know, loading a multi-platform image in docker is not possible (only buildx can handle it)
#738 (comment)
Are there any solution when I don't have a private registry and just want to build an image behind a proxy without messing up with environment variables? Maybe use some cached syntax config or to "spoof" the BuildKit when it tries to download it...
FROM alpine fails offline because BuildKit re-resolves mutable tags on every build; it cannot know whether latest moved without contacting the registry. To build offline, define the dependencies locally: docker pull the base image into the engine store (docker driver), pin by digest (FROM alpine@sha256:...), or point the builder at a registry mirror. The remaining ask for a --pull=missing|never style flag is exactly #1889, please follow that one.
Activity
tonistiigi commentedon Aug 19, 2021
You need to define your build dependencies locally, eg. for
alpine:latestyour need todocker pull alpine:latestor your need to define them with immutable digests. Otherwise builder needs to check if thelatesttag has been updated or not.ranma42 commentedon Aug 20, 2021
Look at the detailed repro; apparently it does not need to check that if a non-BuildKit build has completed locally.
ranma42 commentedon Aug 20, 2021
It might be that the non-BuildKit build implicitly pulls the image (as in
docker pull alpine:latest), while the BuildKit build intentionally does not, so that at every build it is fetched again.Usually I would expect the image to be pulled at the first build (and at every build if the
--pullflag is specified).frichard35 commentedon Mar 8, 2022
Even without talking of cache. It must be possible to build image offline with a private repo. For now, it's impossible with buildkit.
Results in:
Here the internet resources which is mandatory for buildkit :
https://registry-1.docker.io/v2/docker/dockerfile/manifests/1.3
frichard35 commentedon Mar 8, 2022
Sorry, i found a workaround for my "offline" issue. I just entered the following line in my daemon.json.
Tested with docker desktop.
n-bes commentedon May 19, 2022
Usage an image with checksum helped me, example:
centos:7@sha256:c73f515d06b0fa07bb18d8202035e739a494ce760aa73129f60f4bf2bd22b407Aisuko commentedon Sep 19, 2022
Using a checksum of images may help, but we want a cross-platform build engine. The checksum cannot work in the cross-platform build situation.
Aisuko commentedon Sep 19, 2022
We can have a configuration for
buildxhere, namedbuildkitd.toml. Adding configuration for image registry,Reference document: https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md
papb commentedon Sep 20, 2022
I didn't understand this, can you clarify?
Derkades commentedon Sep 21, 2022
A checksum is only valid for one platform, so using a checksum tag won't work. However, I'm not sure how many people really need multi-platform builds offline? As far as I know, loading a multi-platform image in docker is not possible (only buildx can handle it)
ussserrr commentedon Apr 20, 2023
#738 (comment)
Are there any solution when I don't have a private registry and just want to build an image behind a proxy without messing up with environment variables? Maybe use some cached syntax config or to "spoof" the BuildKit when it tries to download it...
JonZeolla commentedon May 1, 2024
I have the same multi-platform offline build problem. Other than running a local mirror I don't see a solution :/
dkadashev commentedon Aug 11, 2025
Would be nice to have a flag for this to happen automatically
crazy-max commentedon Sep 10, 2026
FROM alpinefails offline because BuildKit re-resolves mutable tags on every build; it cannot know whetherlatestmoved without contacting the registry. To build offline, define the dependencies locally:docker pullthe base image into the engine store (docker driver), pin by digest (FROM alpine@sha256:...), or point the builder at a registry mirror. The remaining ask for a--pull=missing|neverstyle flag is exactly #1889, please follow that one.