Skip to content

Use auth configs provided in Docker config file#5507

Open
waduhek wants to merge 2 commits into
hyperledger:mainfrom
waduhek:docker-auth-creds
Open

Use auth configs provided in Docker config file#5507
waduhek wants to merge 2 commits into
hyperledger:mainfrom
waduhek:docker-auth-creds

Conversation

@waduhek

@waduhek waduhek commented Jun 28, 2026

Copy link
Copy Markdown

Type of change

  • New feature

Description

Detects a mounted Docker configuration file in either $HOME/.dockercfg or $HOME/.docker/config.json and 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.

@waduhek waduhek requested a review from a team as a code owner June 28, 2026 17:35
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>
@waduhek waduhek force-pushed the docker-auth-creds branch from 36804a6 to 7d79748 Compare June 29, 2026 03:28
@waduhek

waduhek commented Jul 1, 2026

Copy link
Copy Markdown
Author

@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.

@waduhek

waduhek commented Jul 9, 2026

Copy link
Copy Markdown
Author

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 fabric-baseos to the private repository, updated the core.yaml to use this private image and started the test network. Then, I tried deploying the asset transfer basic chaincode which resulted in an error saying that pull access is denied for the image.

@waduhek waduhek marked this pull request as draft July 9, 2026 18:08
* 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>
@waduhek

waduhek commented Jul 13, 2026

Copy link
Copy Markdown
Author

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 ~/.dockercfg file since Docker CLI does not use this file and I'm trying to keep this change as close to the behaviour of Docker CLI as possible.

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.

@waduhek waduhek marked this pull request as ready for review July 13, 2026 17:41
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

Successfully merging this pull request may close these issues.

1 participant