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

Add optional registry credentials to push() #1245

Merged
merged 1 commit into from
May 31, 2023

Conversation

manics
Copy link
Member

@manics manics commented Feb 12, 2023

This is to help with setting dynamic registry credentials when pushing in BinderHub

Example using traitlets on the command line:

repo2docker --push --no-run --image-name docker.io/USERNAME/image:test --ContainerEngine.registry_credentials=registry=docker.io --ContainerEngine.registry_credentials=username=USERNAME --ContainerEngine.registry_credentials=password=PASSWORD https://github.com/binderhub-ci-repos/cached-minimal-dockerfile

Example using environment variable:
CONTAINER_ENGINE_REGISTRY_CREDENTIALS='{"registry":"docker.io","username":"USERNAME","password":"PASSWORD"}' repo2docker --push --no-run --image-name docker.io/USERNAME/image:test https://github.com/binderhub-ci-repos/cached-minimal-dockerfile

@minrk
Copy link
Member

minrk commented Feb 21, 2023

LGTM! My only question, when thinking about jupyterhub/binderhub#1637 / secrets, etc. is: is there value in making it easier to pass just the password via a distinct variable? i.e. in the token case, not requiring rebuilding the container dictionary, but pass the single key that actually changes each time in an environment variable? If it doesn't make a difference, then this looks AOK to me.

@manics manics closed this May 23, 2023
@manics manics reopened this May 23, 2023
@manics
Copy link
Member Author

manics commented May 23, 2023

I can see the value in a separate env var for just the password, the decision is whether to add it now, or leave it for when there's demand?

Probably the main decision is whether passing the registry parameters as a JSON blob is acceptable, or whether a more structured approach with separate registry:str username:str password:str properties is better. I like the flexibility of the JSON blob, and it means a separate password field can be added later as a non-breaking change, but I'm also happy to switch to the individual fields if that's preferred.

@manics manics closed this May 31, 2023
@manics manics reopened this May 31, 2023
@manics
Copy link
Member Author

manics commented May 31, 2023

I'm merging this since it's been approved, and has had a few days for additional comments.

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

Successfully merging this pull request may close these issues.

2 participants