Skip to content
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

Unable to use docker / docker-compose when auth fails #74

Open
duxbuse opened this issue Feb 20, 2020 · 2 comments
Open

Unable to use docker / docker-compose when auth fails #74

duxbuse opened this issue Feb 20, 2020 · 2 comments

Comments

@duxbuse
Copy link

duxbuse commented Feb 20, 2020

If my password changes or there is a network issue and google-cloud-sdk/bin/docker-credential-gcr get fails you will be unable to run any commands locally using docker or docker-compose that have nothing to do with gcloud.

This is a massive pain, that my docker commands have been completely hijacked and if there is an issue with gcloud, then nothing works.

I would expect for it to try and do gcloud stuff, but upon failure let me do what I wanted any way.

It does my head in seeing [1249] Failed to execute script docker-compose for a totally gcloud independent task.

@jonjohnsonjr
Copy link
Contributor

I'd say this is mostly an issue with docker. I believe (@dekkagaijin can correct me if I'm wrong) that docker will fetch all credentials for all registries in your config file before initiating a build, just in case the daemon needs them.

It's a pain to workaround :/ you could remove any unnecessary registries from ~/.docker/config.json or even set up different config files that are stripped down to only contain necessary registries (using to set an appropriate DOCKER_CONFIG or something).

Possibly you could fix this in docker, but I'm not familiar enough with how credentials are fetched and plumbed around to give a reasonable pointer.

FWIW I think this used to be a lot worse before docker/cli#840 and the number of times docker would fetch credentials increased quadratically with the number of configured registries. At least now it's linear 🤷‍♂

@xak2000
Copy link

xak2000 commented Aug 2, 2020

docker will fetch all credentials for all registries in your config file before initiating a build, just in case the daemon needs them

It's a design flaw then, I think... Why docker even tries to do any network calls while all I trying to do is build local image, that is not related to corresponding credential helper in any way?

There should be some method for daemon to say "I need credentials for gcr.io" and only then docker should try to use corresponding credentials helper. Doing it beforehand "just in case" is insane, imho. :-) It not only slows down entirely local operation (that is not related to any credential helpers), but also just prevents to do this operation at all if some helper responds with error or there is a network error.

But anyway it's a docker's design flaw, not docker-credential-gcr's, if I understand right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants