Credentials and docker login

539 views
Skip to first unread message

Lorin Hochstein

unread,
Apr 30, 2017, 8:45:53 PM4/30/17
to Ansible Container
Hi there:


When pushing images with Ansible Container you can authenticate with the registry by passing your credentials using the --username and --password options. On successful authentication your credentials are encrypted and stored in ~/.docker/config.json, exactly as if you had authenticated using docker login.


I assumed that I could just use "docker login" to set the credentials and ansible-container would then be able to read them, but it appears that doesn't work, and the ~/.docker/config.json file is slightly different if I do "docker login" versus doing "ansible-container push --username $USERNAME --password $PASSWORD"

Are there any plans to supporting "docker login" as a mechanism for passing Docker credentials to Ansible Container? Or, alternately, prompting the user for a password instead of passing it as a parameter on the command-line? I'm generally not a fan of passing passwords as command-line arguments since they are then stored in command-line history.


Lorin

Chris Houseknecht

unread,
May 1, 2017, 10:50:35 AM5/1/17
to Ansible Container
Looks like Docker changed how they're storing credentials in ~/.docker/config.json. Seems they've added support for keychains. We'll need to revisit how we encrypt/decrypt credentials in ~/.docker/config.json. Will open an issue for this.

Currently, if you provide a username without a password, it will prompt for a password. If you don't provide username/password, then it will attempt within the conductor container to decrypt them from ~/.docker/config.json.

Thanks for pointing out the new format of the config.json file.

--Chris



Reply all
Reply to author
Forward
0 new messages