LoginSignup
326
309

More than 1 year has passed since last update.

まるでDocker Desktop!!Rancher Desktopの登場です

Last updated at Posted at 2022-02-01

[7/10更新]末尾にDocker DesktopとRancher Desktopの比較を追加しました。


Ranchar社からRanchar Desktopが登場しました。

公式サイトはこちら

rancherdesktop.io_(iPad Air).png

なんとなく、Docker Desktopの代わりになりそうに見えます。

Ranchar Desktopのインストール

公式のインストール手順はこちら。

Widnows、macOS、Linuxに対応しています。

特にWindowsについては

Rancher Desktop requires Windows Subsystem for Linux on Windows; this will automatically be installed as part of the Rancher Desktop setup. Manually downloading a distribution is not necessary.

とのことで、WSLの設定も勝手にやってくれるようです。
ただ、私の環境はすでにWSL2と、WSL2上のDockerが構築済みの状態です。

インストーラーを入手し、ウィザードに従ってインストールします。

image.png

image.png

image.png

Rancher Desktopを使ってみる

初回起動時にContainer Runtimeの選択ダイアログが出ます。WSL2上にDockerの環境を導入済みだからか、dockerd (moby)がデフォルトで選択されていました。

image.png

Acceptを押すと、Ranchar Desktopが起動します。
しれっと、Kubernetesがダウンロードされます。

image.png

画面を一通り眺めてみます

  • Kubernetes Settings

image.png

  • WSL Integration

image.png

  • Port Forwarding

image.png

  • Images

image.png

  • Troubleshooting

image.png

で、何ができるのかしら?

Windows環境でdockerコマンドが使えるぞ!

PS C:\> docker images
REPOSITORY                         TAG                    IMAGE ID       CREATED        SIZE
rancher/mirrored-library-traefik   2.5.6                  2cd4bc25ad14   5 weeks ago    101MB
rancher/local-path-provisioner     v0.0.21                fb9b574e03c3   6 weeks ago    35MB
rancher/mirrored-metrics-server    v0.5.2                 f73640fb5061   2 months ago   64.3MB
rancher/klipper-lb                 v0.3.4                 746788bcc27e   3 months ago   8.08MB
rancher/klipper-helm               v0.6.6-build20211022   194c895f8d63   3 months ago   241MB
rancher/mirrored-coredns-coredns   1.8.6                  a4ca41631cc7   3 months ago   46.8MB
rancher/mirrored-pause             3.6                    6270bb605e12   5 months ago   683kB
PS C:\>

まるでDocker Desktop!!

PS C:\> docker run hello-world

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.
    (amd64)
 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/

まるでDocker Desktop!!
hello-worldの実行はうまくいくのですが、実行中のままプロンプトが返ってきません。。なぜ?)

Docker Composeもいける!!

PS C:\> docker compose

Usage:  docker compose [OPTIONS] COMMAND

Docker Compose

Options:
      --ansi string                Control when to print ANSI control
                                   characters ("never"|"always"|"auto")
                                   (default "auto")
      --env-file string            Specify an alternate environment file.
  -f, --file stringArray           Compose configuration files
      --profile stringArray        Specify a profile to enable
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the Compose file)
  -p, --project-name string        Project name

Commands:
  build       Build or rebuild services
  convert     Converts the compose file to platform's canonical format
  cp          Copy files/folders between a service container and the local filesystem
  create      Creates containers for a service.
  down        Stop and remove containers, networks
  events      Receive real time events from containers.
  exec        Execute a command in a running container.
  images      List images used by the created containers
  kill        Force stop service containers.
  logs        View output from containers
  ls          List running compose projects
  pause       pause services
  port        Print the public port for a port binding.
  ps          List containers
  pull        Pull service images
  push        Push service images
  restart     Restart containers
  rm          Removes stopped service containers
  run         Run a one-off command on a service.
  start       Start services
  stop        Stop services
  top         Display the running processes
  unpause     unpause services
  up          Create and start containers

Run 'docker compose COMMAND --help' for more information on a command.
PS C:\>

まるでDocker Desktop!!
(細かい点ですが、docker-composeはだめでした。)

Windows環境でkubectlコマンドが使えるぞ!

PS C:\> kubectl get services
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.43.0.1    <none>        443/TCP   10m
PS C:\>

まるでDocker Desktop!!

VSCodeのDocker拡張もいける

image.png

まるでDocker Desktop!!

VSCodeのDev Containerもいける!!!

image.png

まるでDocker Desktop!!
(もう言うことはありません。大満足)

ちなみに

もともとあったWSL2の環境とは別モノのようで、rancher-desktoprancher-desktop-dataが作成されています。

PS C:\>  wsl -l -v
  NAME                    STATE           VERSION
* Ubuntu-20.04            Running         2
  rancher-desktop-data    Stopped         2
  rancher-desktop         Running         2
PS C:\>

まるでDocker Desktop!!

いいんじゃないでしょうか!!


Docker DesktopとRancher Desktopの比較

[2022/7/10追記]
Rancher Desktopの公式サイトで、Rancher Desktopの売りが記載されていました。(あくまでRancher Desktop側の言い分ですのでご参考まで)

項目 Docker Desktop Rancher Desktop
コンテナイメージのビルド、プッシュ、プル
スタンドアロンコンテナの実行
Visual Studio Codeなどの外部ツールとの連携
希望のKubernetesのバージョンの選択
ワークロードがKubernetesのアップグレードにどのように対応するかテスト
containerdとdockerdの選択
326
309
1

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
326
309