macOS へ Rancher Desktop をインストールする
macOS でコンテナ環境を利用するには Docker Desktop を利用する方法があります。 Docker Desktop の Personal 版 は無料ですが、以下の制限があります。
従業員数 250 人以上、または年間収益が10 00万ドルを超える企業でDocker Desktopを商用利用するには、有料サブスクリプション(Pro、Team、Business)が必要です。
代替手段として SUSE が開発している Rancher Desktop が挙げられます。 今回は macOS へ Rancher Desktop をインストールする手順をメモしておきます。
検証環境¶
対象 | バージョン |
---|---|
macOS | Sequoia 15.4.1 |
Rancher Desktop | 1.18.2 |
インストールする¶
Rancher Desktop から自身の環境にあったバイナリをダウンロードし、インストールします。 今回は M4 MacMini 環境で作業している為、Download for macOS (Apple Sillicon)
からバイナリをダウンロードしました。
管理者アクセスを有効化する¶
Rancher Desktop の初回起動時は以下のように表示されます。 今回は初期設定のまま OK
をクリックしました。
初回は Kubernetes のコンポーネントなど、必要なソフトウェアをダウンロードするので少し時間がかかります。 Preferences
をクリックします。
デフォルトで Administrative Access
はチェックが入っていません。
この項目にチェックを入れ Apply
をクリックします。 これで準備完了です。
Docker コマンドを利用する¶
Rancher Desktop での必要コンポーネントのダウンロードやサービスの初期化処理が完了したら CLI から docker info
を実行してみます。 下記の例では Rancher Desktop により 2CPU / 4GB メモリの仮想マシンが作成されていることが分かります。
% docker info
Client:
Version: 27.5.1-rd
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.20.1
Path: /Users/USERNAME/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.33.0
Path: /Users/USERNAME/.docker/cli-plugins/docker-compose
Server:
Containers: 26
Running: 10
Paused: 0
Stopped: 16
Images: 9
Server Version: 26.1.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3a4de459a68952ffb703bbe7f2290861a75b6b67
runc version: 2c9f5602f0ba3d9da1c2596322dfc4e156844890
init version:
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.6.71-0-virt
Operating System: Alpine Linux v3.20
OSType: linux
Architecture: aarch64
CPUs: 2
Total Memory: 3.824GiB
Name: lima-rancher-desktop
ID: d756ab76-225e-40b4-95fe-d20eeaf8d2ce
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
試しに hello-world コンテナを実行してみます。 初回なのでコンテナイメージが Pull され、その後に実行されます。
% docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c9c5fd25a1bd: Pull complete
Digest: sha256:dd01f97f252193ae3210da231b1dca0cffab4aadb3566692d6730bf93f123a48
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
Rancher Desktop から Containers
を確認すると以下のように表示されました。
Kubernetes を無効化する¶
Kubernetes を利用しない場合は Preferences
→ Kubernettes
→ Enable Kubernetes
のチェックを外します。