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
Building with BUILDKIT and cache-from fails in Google Cloud Build #40262
Comments
ping @tonistiigi @AkihiroSuda |
Are you still having this issue on a current version of 19.03? (I see you were using a release candidate; |
Hi, I now tried to re-integrate this using
fails with the following output:
I verified that building without |
Looking at your example again; so that's only the client that's upgraded, correct?
Would you be able to check what version of the daemon is running in Google Cloud Build CI? (e.g., add a |
Correct, that's the only change I made. Possibly Google Cloud Build made other environment changes that I'm not aware of.
|
Ah, yes, that's a pretty old version (and not even up-to-date with the latest |
OK thanks, I'll refer the issue to Google support and will reopen this if I manage to reproduce with an upgraded version. Thanks |
@liiri did you manage to get it to work on Google Cloud Build? |
@lukas1994 not yet, currently waiting for Google to upgrade their Docker server version |
this is also broken in google cloud shell |
@liiri Do you have a ticket in the issuetracker that we can follow? I can't seem to find anything. |
@rdeknijf no sorry, didn't have time or priority to do it yet, would appreciate if anyone else that encountered the issue could report it there |
Cloud Build Upgraded to Docker server version 19.03.8. |
now it works, but for some reason all FROM images need to be pulled - created a helper script for this: https://github.com/matti/gbuilder |
@matti could you describe what's happening if you didn't pull the images? ISTR BuildKit will check the image metadata of the images specified in |
@thaJeztah In google cloud build this happens: moby/buildkit#1271 It does pull them locally when running the exactly same commands. So my workaround is to "scan" all the dependencies and pull them: https://github.com/matti/gbuilder/blob/5cf510f6abe75a69a5a746a377fdb198565ed5f4/gbuilder#L40-L53 |
You're using a registry mirror? Looks like that issue was fixed in moby/buildkit#1397, but I think that's not (yet) in a Docker release. I could try if it's possible to backport for 19.03, but the diff looks rather big, so not sure if it's safe to do so |
Looks like it depends on the containerd 1.3.x client, which is too big of a change, so don't think we'd be able to backport that |
Like I said, this issue happens only in google cloud build which was just updated to 19.03.8 (https://issuetracker.google.com/issues/157501467) and now it supports BuildKit. It might be that google cloud build internally has a registry mirror, don't know. Here's the output from failing google cloud build.
|
I recall some workarounds had to be applied for non-standard things in the gcr registry (moby/buildkit#1143, moby/buildkit#720), but that wouldn't explain why it fails to pull an image from docker hub (unless there's some mirror configured by default on their side perhaps?). Could be worth opening a ticket in the buildkit repository for visibility https://github.com/moby/buildkit/issues 🤔 |
Ah, looks like it's indeed the mirror issue; moby/buildkit#1271. From kubernetes/kubernetes#92030, it appears that Google Cloud configures a mirror ( |
So what's next? Can we mitigate this somehow on environments where mirror is configured? |
I'm pretty sure there is automatic mirror but this image |
I'm not sure what is meant by "automatic mirror", but for example that |
I meant just a mirror that you didn't configure yourself but is automatically added to your build by the infra. Yes, that is the problem with grc mirror that is doesn't fallback itself if it doesn't have contents, like the mirror mode in docker/distribution registry does for example. |
@tonistiigi is there a solution now ? I'm not using cloud build but similarly I pull image from gcr and gcr doesn't contain a image specify in my Dockerfile and i get error image not found. |
https://github.com/matti/buildtagpush/blob/1ede5b2cfad3b0da84aac11e120630b786f64bcc/buildtagpush#L81
here is my workaround, horrible but works.
… On 28. Aug 2020, at 11.23, Gabriel Wu ***@***.***> wrote:
@tonistiigi is there a solution now ? I'm not using cloud build but similarly I pull image from gcr and gcr doesn't contain a image specify in my Dockerfile and i get error image not found.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
…GCB build systems" (#653)" Has bug fixes - Fix for buildkit failures, see moby/moby#40262 Use latest docker version and pull ubuntu:xenial image. - Fix for coverage build failure, also add the dependent {benchmark}-project-builder template. - Add missing tests for base-image and benchmark-coverage cloud build usecases. Original patch by Tanishq Rupaal. This reverts commit 45cad69.
#729) * Reland "Use single source of truth for building images for Local and GCB build systems" (#653)" Has bug fixes - Fix for buildkit failures, see moby/moby#40262 Use latest docker version and pull ubuntu:xenial image. - Fix for coverage build failure, also add the dependent {benchmark}-project-builder template. - Add missing tests for base-image and benchmark-coverage cloud build usecases. Original patch by Tanishq Rupaal. This reverts commit 45cad69. * Fix CI failure with openthread, bump revision. * Revert openthread fix, as it breaks KLEE, unrelated to this CL. * Improve comment based on review.
This is going to get worse with many people, me included, jumping to the gcr mirror since the Docker Hub rate limits. |
I'm trying to migrate my
docker build
in Google Cloud Build CI to useDOCKER_BUILDKIT
.The build step is now using
docker:19.03-rc-dind
:And this works great. However, when I tried to integrate
cache-from
, I'm getting errors. Switching the build command above toFails with the following:
When I run the same command using the same
docker:19.03-rc-dind
image in my local macOS, build completes successfuly with--cache-from
and even actually loads the cache context.Is this an issue with Google Cloud environment? This gitlab issue suggests it may be an issue with gcr (Google Container Registry), but I don't think so, as I can pull from gcr fine locally.
The text was updated successfully, but these errors were encountered: