Proposal/WIP: adding support for external cacerts.txt file#539
Proposal/WIP: adding support for external cacerts.txt file#539roblg wants to merge 1 commit intobazelbuild:masterfrom
Conversation
Work based on (and depends on) google/containerregistry#89
|
@nlopezgi no worries; no rush on my end. I checked out #531, and I'll want that functionality too, eventually :) It feels related, but separate from the issue I'm trying to tackle here. This PR is specifically about being able to override the (incomplete) cacerts.txt file that's bundled with httplib2 down in the depths of containerregistry with one that includes our root CA (or, in others' cases, their internal/private CA). |
|
thanks for the clarifications. This does seem like it would be a useful feature. Is the cacerts something you envision setting for each container_pull rule or is this more of a global setting that you would want all your rules_docker rules to run with. If the latter, then I dont think this is the best approach. We need to create a toolchain rule for docker and this looks like a piece of information that could be stored there. In any case, you probably do need the upstream changes in containerregistry first. We plan on working on a toolchain rule for rules_docker soon, so I'll keep you posted on that. |
Definitely would prefer a single, global setting. I wasn't sure how to achieve that with my bazel knowledge, but the toolchain thing sounds promising if it provides that. I'll go read about toolchains. Going to close this since it seems like the fix will end up being radically different. Thanks for reviewing! |
Note: Work based on (and depends on) google/containerregistry#89
Addresses #273
Wanted to optimistically start the ball rolling on a possible implementation to take advantage of google/containerregistry#89 providing a
--cacertflag. I don't believe this is a complete implementation.Proposal: manage cacerts.txt like any other external dependency: in the WORKSPACE.
Non-working example for illustration:
I was able to make this work and resolve the issue described in #273 using this approach. (Due to
container_pulldependency on a prebuiltpullerartifact from google/containerregistry, in order to really make this work, you also have to separatelybazel build //:puller.parin containerregistry and add it to your workspace aspuller.)I'm open to alternative suggestions as well, this just seemed like a reasonable and reasonably quick route to get from the changes proposed to containerregistry and me having a working build :)
Feedback welcome!