puppetlabs / puppetlabs-docker

The Puppet Docker repository
Apache License 2.0
91 stars 311 forks source link

Switch to --password-stdin for authentication in docker::registry #979

Open dantel35 opened 6 months ago

dantel35 commented 6 months ago

Use Case

I want to be able to authenticate to a private registry in a secure and recommended way, i.e. using --password-stdin and using secrets stored in a vault, not in plaintext in my puppet code/hiera.

Describe the Solution You Would Like

In this module, docker login is not done the recommended way, wich is cat ~/my_password.txt | docker login --username foo --password-stdin https://docs.docker.com/reference/cli/docker/login/

Switching to this form of authentication would not only be the recommended way to use docker login, but it would allow to use secrets stored in the vault easily.

Also switching to the recommended way would eliminate the warnings docker registries throw at you when not using "--password-stdin".

Describe Alternatives You've Considered

I tried passing the password parameter with a deferred function - the module does not work this way.

Additional Context

Add any other context or screenshots about the feature request here.