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

Feature request: Add flag --config #69

Open
uhinze opened this issue Jan 16, 2020 · 3 comments
Open

Feature request: Add flag --config #69

uhinze opened this issue Jan 16, 2020 · 3 comments

Comments

@uhinze
Copy link

uhinze commented Jan 16, 2020

Docker has a global --config flag documented here: https://docs.docker.com/engine/reference/commandline/cli/

Through this, you can define the location of config.json.

docker-credential-gcr configure-docker currently always generates the config file in ~/.docker. It would be nice to be able to modify this in the same way as in Docker.

I try to issue docker-credential-gcr configure-docker during the startup of a COS VM in GCP. It gives me an error that /root/.docker is a read-only filesystem, so I'd just like to put the file somewhere else.

@uhinze uhinze changed the title Add flag --config Feature request: Add flag --config Jan 16, 2020
@dekkagaijin
Copy link
Contributor

dekkagaijin commented Jan 16, 2020

The issue is that docker doesn't supply any parameters to docker-credential-gcr via the credential store API. However, you should be able to use the DOCKER_CONFIG ENV var to specify the directory containing the desired dockerconfig for both docker and docker-credential-gcr

@uhinze
Copy link
Author

uhinze commented Jan 16, 2020

Thanks for responding!
What I have in mind is this:
docker-credential-gcr configure-docker --config /foo/bar -> writes /foo/bar/config.json
docker run eu.gcr.io/my/image --config /foo/bar <- reads /foo/bar/config.json and authenticates with the helper.

@dekkagaijin
Copy link
Contributor

Got it.

FYI only the config directory is user-configurable, config.json is hard-coded.

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

2 participants