bmuschko / gradle-docker-plugin

Gradle plugin for managing Docker images and containers.
https://bmuschko.github.io/gradle-docker-plugin/current/user-guide/
Apache License 2.0
1.23k stars 362 forks source link

Support podman $HOME/.config/containers/auth.json as an alternative to $HOME/.docker/config.json for auth credentials #1223

Open mshannongit opened 3 weeks ago

mshannongit commented 3 weeks ago

Many enterprise environments no longer support the use of docker, and instead use podman.

Running the gradlew dockerBuild action against a private artifactory results in the error -

"unable to retrieve auth token: invalid username/password: unknown: Authentication is required"

This becomes confusing, as one assumes if logged in to podman (via podman login), that the necessary credentials should be available.

However the gradle docker plugin does not know of the podman equivalent auth file to that of Docker's config.json.

One way to solve the problem is to create a symbolic link

mkdir -p $HOME/.docker ln -s $HOME/.config/containers/auth.json $HOME/.docker/config.json

It would be preferrable however if the gradle docker plugin had native support for locating podman's auth.json file.

bmuschko commented 2 weeks ago

I am going to add something to the documentation that explains that Podman is not supported 100%.

I am not planning to add full Podman support, but you you feel strongly about it, please send a pull request. Thanks!