Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

26
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Docker Desktopがmac book proのバッテリーを浪費するのでColimaにしてみた話

Last updated at Posted at 2025-01-28

ことの発端は

  • Docker Desktop for macがバッテリーをとても消費するようだ
  • そして遅い、何よりこれが一番のストレス
  • なので代替を探してたどりついたのが、colima

colimaって

公式Githubにはこう書いています

Colima - container runtimes on macOS (and Linux) with minimal setup.

つまりは、macOSに最適化されたコンテナランタイムだよってことでしょう

インストールの前にDocker Desktopはさようなら

  • dockerで永続化してるデータも消える(というか再構築)ので、必要あればどこかに保存
  • Docker Desktopのバイナリは不要なので削除で良いですが、dockerコマンドとか別途入れてない人はいるのかなとか思ったり思わなかったり。この辺は環境依存ですので適宜
  • 置いときたい人は自動起動をOFFにする必要があります

早速インストール

これはまあbrewで入るので楽

brew install colima

colimaのVMをつくる

  • お使いのmacがappleシリコンであれば、以下のようにすると快適なdocker環境ができます
  • virtioを使うとめちゃくちゃ遅いファイルIOがめちゃくちゃ速くなります(個人の感想です)
colima start --cpu 8 --memory 12 --disk 128 --arch aarch64 --vm-type=vz --vz-rosetta --mount-type virtiofs

dockerコマンドに教えてあげる必要がある

.bash_profileなどに

export DOCKER_HOST="unix://$HOME/.colima/docker.sock"

dockerコマンドで確認

docker ps -a

これでエラーにならなければOKです。あとは普通にdocker compose up などしてみてください。

Special Thanks

(2025/01/30)追記

  • mac osを最新にアップデートしたほうが良いみたいです
    • colima自体がstartできないという現象があるみたい
26
17
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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
26
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?