マイタケノート

マイタケノート

天ぷらは舞茸が至高

Windows 10 HomeでDocker Desktopを入れてみた

概要

f:id:at1795:20210220232849p:plain
随分前から話題のDockerですが、不幸なことにお仕事ではあまり触れる機会がありません。
趣味兼勉強用環境として、ちょっと手を出してみようと思います。

実行環境

OS Windows 10 Home ver.2004(OSビルド:19041.804)
CPU Intel Core i7-3770K
RAM 16GB

インストール

Docker Descktopをインストール
www.docker.com

「Docker Desktop Installer.exe」を実行します。

f:id:at1795:20210220222510p:plain
WSL2のインストールを確認されました。
f:id:at1795:20210220222824p:plain
再起動が求められます。

怒られました。

f:id:at1795:20210220223302p:plain
最新版のLinux Kernelを入れろと?

メッセージに従い、64bit向けのWSL2 Linuxカーネル更新プログラムをインストールします。
aka.ms

f:id:at1795:20210220223841p:plain
出たなペンギン

起動成功!
f:id:at1795:20210220224449p:plain

初心者なのでチュートリアルもやります。
内容としては以下のような感じ。
リポジトリからイメージをダウンロード
・コンテナイメージをビルド
・コンテナを起動(run)
・シェアしてみたかったらシェアしてね

というかビルドやばいですね。ふっつーにCPU使用率90%超えました。
まぁまぁ時間かかるし、二代目自作マシンもi7にしよう。

動作確認

Dockerのバージョン確認もできました。

PS C:\doc\10_dev> docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.7
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:14:16 2020
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0


hello-worldのイメージをPullして実行してみます。

PS C:\doc\10_dev> docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:95ddb6c31407e84e91a986b004aee40975cb0bda14b5949f6faac5d2deadb4b9
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.
    (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/

動いてますね~!!
このメッセージが出てるってことはちゃんと動いてるよって言われるのなんかうれしいですね。

f:id:at1795:20210220231632p:plain
ちゃんとGUI上のイメージリストにも出てきてました。

ひとます導入まではできたみたいで安心です。
次からはUbuntuを動かして遊んでみようと思います。