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

Windows 10 homeでWSL2 + DockerDesktopでDocker環境を構築する手順

Last updated at Posted at 2025-06-13

Windows 10 homeWSL2DockerDesktop をインストールして、Docker の環境を構築してみたので、その時の手順を残します。

1. 環境

項目 詳細
CPU Intel(R) Core(TM) i3-8130U CPU @ 2.20GHz 2.21 GHz
メモリ 8.00 GB
グラフィックス カード Intel(R) UHD Graphics 620 (128 MB)
OS Windows 10 Home バージョン 2009(OSビルド 19045.5854)

2. WSL2 のインストール

2.1. Windows PowerShellを起動

Windowsのスタートメニューから「Windows PowerShell」ー「Windows PowerShell」を右クリックし管理者で実行します。

01.png

2.2. WSL2をインストール(wsl --install

Windows PowerShell で以下のコマンドを実行します。
wsl --install

実行結果
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

新しいクロスプラットフォームの PowerShell をお試しください https://aka.ms/pscore6

PS C:\WINDOWS\system32> wsl --install

 

以下のようにインストールが開始されるので、終了するまで待ちます。

実行結果
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

新しいクロスプラットフォームの PowerShell をお試しください https://aka.ms/pscore6

PS C:\WINDOWS\system32> wsl --install
インストール中: 仮想マシン プラットフォーム
仮想マシン プラットフォーム はインストールされました。
インストール中: Linux  Windows サブシステム
Linux  Windows サブシステム  はインストールされました。
インストール中: Linux  Windows サブシステム
Linux  Windows サブシステム  はインストールされました。
インストール中: Ubuntu
Ubuntu はインストールされました。
要求された操作は正常に終了しました。変更を有効にするには、システムを再起動する必要があります。
PS C:\WINDOWS\system32>

2.3. Windows再起動

Windowsを再起動します。

2.4. Ubuntuのユーザ、パスワード設定

Windowsの再起動後、Ubuntuのインストールが実行されます。
インストール完了後、Ubuntuのユーザ、パスワードがきかれるので設定します。
ここではtest_userのユーザーを入力しています。

実行結果
ダウンロードしています: Ubuntu
インストールしています: Ubuntu
ディストリビューションが正常にインストールされました。'wsl.exe -d Ubuntu' を使用して起動できます
Ubuntu を起動しています...
Provisioning the new WSL instance Ubuntu
This might take a while...
Create a default Unix user account: test_user
New password:
Retype new password:
passwd: password updated successfully
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

test_user@hostname:/mnt/c/WINDOWS/system32$

3. DockerDesktop のインストール

3.1. DockerDesktopのインストーラーのダウンロード

Docker 公式ページ」を開き、Docker Desktop Installer.exeをダウンロードします。

07.png

3.2. DockerDesktopのインストーラーを実行

Docker Desktop Installer.exeを実行します。
以下の画面で「OK」をクリックします。

08.png

 

インストールが開始されるのでしばらく待ちます。

09.png

 

「Close and log out」をクリックします。

10.png

3.3. Windowsの再起動

Windowsを再起動します。

3.4. Dcokerの設定

Windows再起動後、Dockerの同意が求められるので、「Accept」をクリックします。

11.png

メールアドレスを聞かれますが、「Skip」をクリックします。

13.png

 

役割を聞かれますが、「Skip」をクリックします。

15.png

 

右上の設定(歯車アイコン)をクリックします。

16.png

 

「Resources」をクリックします。

17.png

 

「Resources」-「WSL integration」をクリックします。

18.png

 

「Enable integration with my default WSL distro」にチェックが付いていることを確認し、「Ubuntu」をチェックして、「Apply & restart」をクリックします。

22.png

4. Docker の動作確認

4.1. Ubuntu 起動

Windowsのスタートメニューから「Ubuntu」を選択します。

21.png

4.2. Docker のバージョン確認

Ubuntuで以下のコマンドで、インストールされたdockerのバージョンを確認します。

docker --version

実行結果
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

test_user@hostname:~$ docker --version
Docker version 28.1.1, build 4eba377
test_user@hostname:~$

4.3. hello-world の実行

Ubuntuで以下のコマンドで、docker の hello-world を実行します。

docker run hello-world

以下のメッセージが表示されると成功です。
Hello from Docker!
This message shows that your installation appears to be working correctly.

実行結果
test_user@hostname:~$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
e6590344b1a5: Pull complete
Digest: sha256:940c619fbd418f9b2b1b63e25d8861f9cc1b46e3fc8b018ccfe8b78f19b8cc4f
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/

test_user@hostname:~$

以上

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