1
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?

Colimaとは?Docker Desktopを使わずにMacでDocker環境を構築する方法とアーキテクチャ指定の理由

Posted at

はじめに

Colimaは、Docker Desktopを使わずに軽量な仮想環境を提供してくれる便利ツール。

本記事では、「Colimaとは何か?」「なぜアーキテクチャ指定が必要なのか?」について整理する。


Colimaとは?

Colimaは「Containers on Lima」の略で、macOSやLinux上に軽量なLinux仮想マシンを立て、その中でDockerエンジンを動かすためのツール。

内部的には、Limaという仮想マシンツールの上にDocker環境を構築している。

インストールと起動例

brew install colima
colima start

なぜアーキテクチャの指定が必要なのか?

MacでDockerを使う場合に注意が必要なのが「CPUアーキテクチャの違い」。

DockerイメージはLinux上で動作しますが、その中のバイナリがIntel(x86_64)向けなのか、Apple Silicon(arm64)向けなのかによって、正しく動作しないケースがある。

例えば、MacがM3なのに、Intel向けのDockerイメージを使おうとするとエラーになる。

これを避けるために、Colimaを起動する際にアーキテクチャを明示的に指定することが必要。

起動時のアーキテクチャ指定例

# x86_64 (Intel/AMD) 向けで起動
colima start --arch x86_64

# arm64 (Apple Silicon) 向けで起動(通常はこれがデフォルト)
colima start --arch aarch64

おわりに

ColimaはDocker環境を構築できる便利なツール。
Dockerイメージを使うときは、アーキテクチャの違いを把握しておくことが重要であることが一番の学び。

1
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
1
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?