11
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macOSで~/.docker/config.jsonのauthesに認証文字列がない場合の対処

Posted at
{
	"auths": {
		"https://index.docker.io/v1/": {}
	},
	"HttpHeaders": {
		"User-Agent": "Docker-Client/19.03.1 (darwin)"
	},
	"credsStore": "desktop",
	"experimental": "disabled",
	"stackOrchestrator": "swarm"
}

~/.docker/config.jsonがこんな内容になっていて、authesにauthがない時にkubernetesでprivateなDocker hubからイメージを取得しようとすると設定が作れなくて困りますね。これはおそらくDocker for Macを使っているときに発生します。

Docker for Macの設定画面を開きます。

Screen Shot 2019-08-26 at 14.38.34.png

開いたら、 Securely store Docker login in macOS keychain のチェックを外します。

Screen Shot 2019-08-26 at 14.39.50.png

その後、~/.docker/config.json から、credsStoreのキーを消して、

{
	"auths": {
		"https://index.docker.io/v1/": {}
	},
	"HttpHeaders": {
		"User-Agent": "Docker-Client/19.03.1 (darwin)"
	},
	"experimental": "disabled",
	"stackOrchestrator": "swarm"
}

このようにしたら、 docker login コマンドでログインすると、

{
	"auths": {
		"https://index.docker.io/v1/": {
			"auth": "ここにはいる"
		}
	},
	"HttpHeaders": {
		"User-Agent": "Docker-Client/19.03.1 (darwin)"
	},
	"experimental": "disabled",
	"stackOrchestrator": "swarm"
}

この様になります。これでおっけー。

11
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?