buildkit: buildkit + gcr.io private repos (credHelpers) do not stack

Docker 18.09-ce here.

I have FROM directive in my dockerfile pointing to a private registry:

FROM gcr.io/...

Running DOCKER_BUILDKIT=1 docker build . with this Dockerfile never finishes (after 5 minutes I hit CTRL-C). Without buildkit it builds fine in seconds.

My ~/.docker/config.json is as follows:

{
  "credHelpers": {
    "us.gcr.io": "gcloud",
    "staging-k8s.gcr.io": "gcloud",
    "asia.gcr.io": "gcloud",
    "gcr.io": "gcloud",
    "marketplace.gcr.io": "gcloud",
    "eu.gcr.io": "gcloud"
  }
}

After waiting long time and pressing CTRL-C, the following error is printed (exact image names scrambled with ...):

------
 > [stage-1 1/4] FROM gcr.io/...:
------
failed to copy: httpReaderSeeker: failed open: unexpected status code https://gcr.io/v2/...: 403 Forbidden

Bug?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 38 (13 by maintainers)

Most upvoted comments

@michael-gillett Can you try Docker v19.03 with https://github.com/moby/moby/pull/38246 ?

I’m closing this issue because it seems fixed now, but feel free to ping us if you are still hitting.

I also tested the latest standalone buildkitd as well and it works fine.

Workaround PR https://github.com/moby/moby/pull/38246 got merged into DOCKER_BUILDKIT mode (but not into standalone buildkitd yet)

Looks like the work-around is going to be merged into docker-ce 18.09.1: https://github.com/docker/engine/pull/122