4
2

メモリ不足でエラーになったのでDockerのメモリを上げた

Posted at

環境

  • M1 Mac
    • OS Ventura v13.6
  • Docker Desktop
    • v4.22.1

経緯

$ docker build . -t erdを実行した。1時間40分ほどbuildを実行した挙句、以下のエラーが出て処理が中断してしまった。

Error: cabal: Failed to build graphviz-2999.20.1.0 (which is required by
exe:erd from erd-0.2.1.0). The build process was killed (i.e. SIGKILL). The
typical reason for this is that there is not enough memory available (e.g. the
OS killed a process using lots of memory).

エラーメッセージを見ると、メモリ不足のようだ。
使用しているM1 Macのメモリは8Gしかなく、アクティビティモニタで確認すると確かに処理がかなり重そうだった。

対応

これを機にメモリ16GのMacに買い替えようと思ったが、もっと良い(そして早い)解決策があった。

『Docker for Desktop』で、「Extensions」 -> 「Settings」 -> 「Resources」を開き、「Memory」の欄で4Gから6Gに変更し、右下の「Apply & restart』ボタンを押す。

これでDockerが使用するメモリを6Gまで増やすことができた。

スクリーンショット 2023-10-12 21.07.11.png

参考

4
2
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
4
2