Use auth configs provided in Docker config file#5507
Conversation
Detects a mounted Docker configuration file and parses it for authentication information and passes the authentication details to the Docker client for building the chaincode image. closes hyperledger#5504 Signed-off-by: Ryan Noronha <ryannor56a@proton.me>
36804a6 to
7d79748
Compare
|
@pfi79, please have a look at my PR when possible. I'd also like to request some help in testing these changes on an actual private repository. I tried spinning up a local Nexus repository but I'm having some trouble on that front since Fabric is attempting to use HTTPS which I couldn't setup yet. If I do succeed in testing these changes on a private repository, I'll report back. |
|
Update on testing this change on a private repository. I tried testing using a private repository on Docker Hub and found that the same issue persists. Moving this PR to draft mode while I work on getting it to work. Here's what I did: I pushed a re-tagged version of |
* Converts base64 encoded "auth" string to username and password before sending it in the auth configs while building an image. * Remove `~/.dockercfg` config file support. Signed-off-by: Ryan Noronha <ryannor56a@proton.me>
|
I've managed to figure out how authentication works with the Docker engine. Turns out, the Docker engine does not pick up the base-64 encoded "auth" string from the config file. It only recognises "username" and "password" fields for a particular registry. The PR has been updated to reflect this. Additionally, I've also removed support for the I've also managed to test this successfully by using the same method I've mentioned in my previous comment. Marking this PR as ready for review. |
Type of change
Description
Detects a mounted Docker configuration file in either
$HOME/.dockercfgor$HOME/.docker/config.jsonand parses it for authentication information. If either one of the files contains authentication information, the details are sent over to the Docker client library to be sent to the Docker socket for building the chaincode image.Additional details
I ran the updated test files but I currently do have access to a private repository against which I can test the changes.
Related issues
See #5504.