Docker Community Forums

Share and learn in the Docker community.

Docker credentials helper: can't get it working

I tested the configuration for using a credential helper but docker push seems to ignore the .docker/config.json in my home directory.
This is what I have
I’m trying to create a bash script to parse environment variables and give the expected answers to username and password.
The current helper code have only debug purposes to understand the protocol and create the expected functions.
I used to different GNU/Linux distros: Gentoo and Arch. Neither work with the most updated docker version.
I’m using OS with CPU x86 64bit arch.

Doesn’t look like a valid config file.

You can simply call docker login with the --username and --password-stdin parameters. More infos in the docs.

To run the docker login command non-interactively, you can set the --password-stdin flag to provide a password through STDIN. Using STDIN prevents the password from ending up in the shell’s history, or log-files.

The following example reads a password from a file, and passes it to the docker login command using STDIN:

$ cat ~/my_password.txt | docker login --username foo --password-stdin