Unable to push to provide repository using credHelpers
Hey,
I'm trying to use buildx to do some multi-arch builds in our infrastructure. We use Google Container Registry which configures credHelpers like so:
bash-4.2$ cat ~/.docker/config.json
{
"auths": {},
"credHelpers": {
"asia.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"gcr.io": "gcloud",
"marketplace.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud",
"us.gcr.io": "gcloud"
}
However when using buildx --push, I get a 401:
=> => pushing layers 1.5s
------
> exporting to image:
------
error: failed to solve: authorization status: 401: authorization failed
I'd imagine I can get around this by running a docker login first? But feels a bit crude?
Should this be working (eg not sure if it's a bug, feature request, or never-gonna-happen).
Have you confirmed that your setup is correct, eg. by running docker pull?
You don't need docker login if the credential helper is properly configured already.
Hello @tonistiigi, Yes that was my expectation too.
For context; our CI agents currently don't use buildx, they're using docker and docker-compose with the credHelper. I was experimenting switching out to buildx, but ran into this problem (on the same agents that authenticate just fine without buildx).
I did check the environment was setup correctly, but will tripple check again for you in the next day or two! Thanks
@Stono did you ever get this to work?
Related issues: https://github.com/community/community/discussions/42889 https://github.com/docker/buildx/issues/1528 https://github.com/docker/buildx/issues/960