.docker/config.json vs .dockercfg

走远了吗. 提交于 2019-12-21 06:49:12

问题


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?


回答1:


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.json and support for HTTP Headers

This PR does the following:

  • migrated ~/.dockerfg to ~/.docker/config.json.
    The data is migrated but the old file remains in case its needed.


来源:https://stackoverflow.com/questions/35519072/docker-config-json-vs-dockercfg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!