When I do a docker login to a private repository using docker 1.10.1, an entry is created in my ~/.docker/config.json file. Is this file in the same format as what I see being called a .dockercfg file? Is the config.json file interchangeable with a .dockercfg file?
I assume config.json is the new .dockercfg file.
See "docker/cliconfig/config.go"
// ConfigFileName is the name of config file ConfigFileName = "config.json" oldConfigfile = ".dockercfg" The new config file is now documented under man/config-json.5.md
That was introduced in commit 18c9b6c in docker 1.7.0 (April 2015)
Add
.docker/config.jsonand support for HTTP HeadersThis PR does the following:
- migrated
~/.dockerfgto~/.docker/config.json.
The data is migrated but the old file remains in case its needed.
Note: since 2016:
config-json.5 to docker-config-json.5 (commit a596d3d, docker docs-v1.12.0-2016-07-28 )docker/cli (commit b5579a4, Docker v17.07.0-ce-rc1)It differs from docker-daemon.8.md which uses by default /etc/docker/daemon.json, the daemon configuration file introduced with Docker v1.10.
So:
config.json is for the docker CLI daemon.json is for the dockerd (daemon) CLI But the config.json (which applies to all containers) does not include docker run network settings: --net=host could not be specified in that config file.
Update 2021 (since 2017), as noted by slm in the comments:
The credentials are now stored in whatever your OS makes use of for managing secrets.
On MacOS they get stored under Keychain, you can find them by looking for "Docker Credentials" under All Items
You can see the project docker/docker-credential-helpers: a suite of programs to use native stores to keep Docker credentials safe.
See docker login/Credentials Store for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With