6
0

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 1 year has passed since last update.

Apple シリコン搭載の Mac で Docker が起動と停止を繰り返す時の解消方法

Last updated at Posted at 2022-02-13

Docker Desktop 4.5.0 のリリースで Mac M1 の CPU 数が 8 に制限され、本記事で紹介している起動時の不具合が発生しなくなりました。https://github.com/docker/for-mac/issues/6063

先月、Apple シリコン搭載の Mac で、Docker Engine の CPU を最大値の「10」に設定してみました。すると、以下の画像のように起動と停止状態を永遠に切り替え続ける悪循環が始まりました。

ezgif-3-a143df8ec8.gif

PCの再起動で治らなかったので、止むを得ず Docker CLI を AppCleaner で完全に削除しました。再インストールして立ち上げたところ、何も変わっていません。ご存じの通り、Apple シリコンの Mac でコンテナクライアントが使えないことは、開発者にとって致命的です。自己解決を諦めてサポートに連絡したところ、以下の回答をいただきました。

Apologies for the inconvenience. Unfortunately the virtualization framework can only use a maximum of 8 CPUs, so it should have been capped at 8. Try setting the CPUs back to 8 in your settings.json file and it should start up.

「ご迷惑をおかけして申し訳ございません。残念ながら仮想化フレームワークは最大8CPUまでしか使用できないため、上限が8になっていたはずです。 settings.jsonファイルでCPUを8に戻してみてください、起動するようになるはずです。」

settings.json を数分探したところ、ここにありました。AppCleaner でさえ、このファイルの存在を知らなかったようです。

~/Library/Group\ Containers/group.com.docker/settings.json

中身を見ると、見覚えのある項目がいくつもあります。

{
  "autoDownloadUpdates": false,
  "cpus": 10,
  "diskSizeMiB": 98304,
  "filesharingDirectories": [
    "/Users",
    "/Volumes",
    "/private",
    "/tmp",
    "/var/folders"
  ],
  "kubernetesEnabled": false,
  "memoryMiB": 16384
}

サポートに言われた通り、10 → 8 に戻したところ、無事起動するようになりました。

- "cpus": 10,
+ "cpus": 8,
6
0
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
6
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?