-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails when FROM image isn't cached #2033
Comments
Same issue here and the same workaround fix. Just to chime in with more info: docker version
docker info
The image I had trouble with was
I got the same error in docker-compose and with docker-build. On the other hand, the above user appears to be running on Linux, so it probably isn't related to the current Windows/Linux jankiness. I won't be doing further analysis on my own since I'm unblocked thanks to the above suggestion, but I'm happy to run troubleshooting steps on request, just ping me. Hopefully this helps track it down! |
just bumped into this issue too:
setting DOCKER_BUILDKIT=0 or pulling image first makes it work |
my docker version if that helps:
|
Can't reproduce this with 20.10.6 anymore.. maybe give that version a try. |
In tests performed on the version: I am faced with the same scenario. FROM andreptb / jboss-as: 4.0.5.GA-jdk6 Log error: => [1/8] FROM docker.io/andreptb/jboss-as:4.0.5.GA-jdk6@sha256:372fcbd3dc9b2ca511c2638cee7e4cab7ab71a429d15b169abd7a35d77c947eb:failed to load cache key: invalid empty config file resolved for docker.io/andreptb/jboss-as:4.0.5.GA-jdk6@sha256:372fcbd3dc9b2ca511c2638cee7e4cab7ab71a429d15b169abd7a35d77c947eb |
@maxandersen Can repro on 20.10.6 too with: cat > Dockerfile <<EOL
FROM quay.io/wsiqueir/dashbuilder-runtime:latest
EOL
docker build -t dashbuilder-dev .
Have also tried with docker buildx imagetools inspect busybox:ubuntu-14.04
Maybe it should be taken into account here (see moby/moby#42035). WDYT @thaJeztah @tonistiigi? |
Hmmm.. first of all: these images are really old, and I would highly recommend updating to something more recent if you're still using these. For example, the If you pull these images, you will see a warning about them as well; $ ubuntu-14.04: Pulling from library/busybox
Image docker.io/library/busybox:ubuntu-14.04 uses outdated schema1 manifest format.
Please upgrade to a schema2 image for better future compatibility.
More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/
a3ed95caeb02: Pull complete
300273678d06: Pull complete
Digest: sha256:7d3ce4e482101f0c484602dd6687c826bb8bef6295739088c58e84245845912e
Status: Downloaded newer image for busybox:ubuntu-14.04
docker.io/library/busybox:ubuntu-14.04 I know Docker Hub can perform automatic conversion of old v1 manifests (but there are requests to remove that functionality; docker/roadmap#173), but other registries may not be doing so. I'm wondering if BuildKit is setting Set the repo and tag we're interested in: export repo=library/busybox
export tag=ubuntu-14.04 Get a token for pulling: export token="$(curl -fsSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq --raw-output '.token')"; Fetch the image manifest either with curl -H "Authorization: Bearer $token" \
-H 'Accept: application/vnd.docker.distribution.manifest.v1+json' \
"https://registry-1.docker.io/v2/${repo}/manifests/${tag}" Or without setting an curl -H "Authorization: Bearer $token" \
"https://registry-1.docker.io/v2/${repo}/manifests/${tag}" Doing this will return the deprecated v1 manifest (without conversion); {
"schemaVersion": 1,
"name": "library/busybox",
"tag": "latest",
"architecture": "amd64",
"fsLayers": [
{
"blobSum": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"
},
{
"blobSum": "sha256:aa2a8d90b84cb2a9c422e7005cd166a008ccf22ef5d7d4f07128478585ce35ea"
}
],
"history": [
{
"v1Compatibility": "{\"architecture\":\"amd64\",\"config\":{\"Hostname\":\"\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"sh\"],\"Image\":\"sha256:2e0187ff200dd4f19eb4761e7505f1759ffd70945e4fdb3a1de1b79316374cfd\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":null},\"container\":\"22c781af50cbbf2c31a3fb57c21d4dcfb266d6691441657088db6750d4068d22\",\"container_config\":{\"Hostname\":\"22c781af50cb\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/sh\",\"-c\",\"#(nop) \",\"CMD [\\\"sh\\\"]\"],\"Image\":\"sha256:2e0187ff200dd4f19eb4761e7505f1759ffd70945e4fdb3a1de1b79316374cfd\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":{}},\"created\":\"2021-05-04T00:19:49.531663542Z\",\"docker_version\":\"19.03.12\",\"id\":\"84cb8ccbcdc1d3bc6f8a6f5a333edd1c46330aaca78a53669548e402d1b94d24\",\"os\":\"linux\",\"parent\":\"f9e6fa26c87498faaac3bbf2ca180cc48860e09b766e947953ec751ff58cc8fd\",\"throwaway\":true}"
},
{
"v1Compatibility": "{\"id\":\"f9e6fa26c87498faaac3bbf2ca180cc48860e09b766e947953ec751ff58cc8fd\",\"created\":\"2021-05-04T00:19:49.383853296Z\",\"container_config\":{\"Cmd\":[\"/bin/sh -c #(nop) ADD file:dc794c2febce9ec5b68ca4f55027eb4e7d42fc7941e15ba578585d8a166d2d13 in / \"]}}"
}
],
"signatures": [
{
"header": {
"jwk": {
"crv": "P-256",
"kid": "MWHM:JHDO:OXRV:JO5X:M526:KM6P:4K2F:HSBD:2YRH:HLZH:2HBW:PS6E",
"kty": "EC",
"x": "7EiIBff9Ez60hCM6z92veGPHcOJMeyndmmG1eA4JWvk",
"y": "1rBfT1bCfWxJE_OxsTfaO87BWwGC55NNLF-l1StiK-4"
},
"alg": "ES256"
},
"signature": "vfsVjDspELt7_ae5OWfs9d0cCsFiRHNwtqOuy_-JFI2OuVlM25aY7uP9IBHLYuMB37-4zgUNuHI3z9MpUNJVbQ",
"protected": "eyJmb3JtYXRMZW5ndGgiOjIwODgsImZvcm1hdFRhaWwiOiJDbjAiLCJ0aW1lIjoiMjAyMS0wNS0wN1QxNjowNDozNFoifQ"
}
]
} However, setting some accept headers (in this case manifest v2 and v1); curl -H "Authorization: Bearer $token" \
-H 'Accept: application/vnd.docker.distribution.manifest.v2+json' \
-H 'Accept: application/vnd.docker.distribution.manifest.v1+json' \
"https://registry-1.docker.io/v2/${repo}/manifests/${tag}" Docker Hub will return a converted v2 manifest: {
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 1457,
"digest": "sha256:c55b0f125dc65ee6a9a78307d9a2dfc446e96af7477ca29ddd4945fd398cc698"
},
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 766644,
"digest": "sha256:aa2a8d90b84cb2a9c422e7005cd166a008ccf22ef5d7d4f07128478585ce35ea"
}
]
} |
I am still having this issue |
I am experiencing this issue (#1271) with the current release available to me (Client version:
20.10.5
). Today was the first time I've seen this occur.I did as the folks in the previous issue mentioned (the comment), using
DOCKER_BUILDKIT=0
which allowed the build to pass without errors. In my case the problematic image I am using is,busybox:ubuntu-14.04
.Reproduction Steps
To test if any other images were causing an issue, I removed all images on my machine, as well as all containers. So,
docker ps -a
anddocker images
give no results. I then ran mydocker build
(withoutDOCKER_BUILDKIT=0
) using my local Dockerfile which contains the line,FROM busybox:ubuntu-14.04
, and received this error:After ensuring that all images and containers were removed once again, I ran
docker pull
on the image I needed, which succeeded. I then re-ran my build (again withoutDOCKER_BUILDKIT=0
), and the build passed as expected.Additional Info
So, for me,
busybox:ubuntu-14.04
is not being resolved properly and prevents builds when not cached. UsingDOCKER_BUILDKIT=0
allows me to skip that caching step and build without any images already pulled.I do not know how to update my Buildkit version from
v0.5.1-docker
separately from Docker itself, so I cannot test the version combination quoted above. I pulled this version # from thedocker info
dump, so it may be incorrect, my apologies if it is.docker version
docker info
The text was updated successfully, but these errors were encountered: