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

FR: Use the .netrc for authentication information when pulling images #741

Open
shs96c opened this issue Dec 5, 2024 · 3 comments
Open

Comments

@shs96c
Copy link

shs96c commented Dec 5, 2024

The Bazel downloader is configured to use the user's .netrc by default. When looking for credentials when pulling an image, it would be nice if rules_oci also used information from the .netrc too. This would allow people to download content from a docker server that requires authentication without also needing the docker CLI tools to be present on their machine, and it would provide a consistent mental model for people about how authentication when downloading with Bazel should work.

@shs96c
Copy link
Author

shs96c commented Dec 5, 2024

This would also provide a mechanism for users to avoid needing to patch the _WWW constant in authn.bzl for privately hosted docker servers.

@thesayyn
Copy link
Collaborator

thesayyn commented Dec 5, 2024

.netrc should be working already as we use rctx.download for fetching the images, the _WWW constant is something we have to do perform the exchange.

@shs96c
Copy link
Author

shs96c commented Dec 9, 2024

I'll need to check, but I've certainly tried to pull from a docker repo that needed authentication and found that only worked once I'd added the credentials to my osxkeychain.

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