Skip to content

Commit 4615d75

Browse files
committed
Update WSL 2 + Docker description
1 parent e1b5932 commit 4615d75

File tree

11 files changed

+108
-6
lines changed

11 files changed

+108
-6
lines changed

docs/images/intro3-1.png

252 KB
Loading

docs/images/intro3-2.png

58.1 KB
Loading

docs/images/intro3-3.png

70.3 KB
Loading

docs/images/intro3-4.png

192 KB
Loading

docs/images/intro3-5.png

198 KB
Loading

docs/images/intro3-6.png

274 KB
Loading

docs/images/intro3-7.png

365 KB
Loading

docs/images/step0-5.png

30.7 KB
Loading

docs/images/step0-6.png

264 KB
Loading

docs/intro3.md

Lines changed: 105 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,31 @@
77
## Dockerのインストール
88

99
ドキュメントを参考にしながらDockerをインストールします。
10-
インストール手順は変わる可能性がありますので公式から案内される資料を参照してください。
10+
インストール手順は変わる可能性がありますので公式から案内される資料を参照してください。
11+
※ 2022年6月現在、WindowsでDockerを使用する際によく用いられる「Docker Desktop」は、 __一定の条件を満たしている場合を除いて有料__ です。詳しくは本資料の「参考情報」を参照してください。
1112

1213
* 公式ドキュメント(英語)
1314
* https://docs.docker.com/desktop/windows/install/
1415
* 有志による非公式ドキュメント(日本語)
1516
* https://qiita.com/zaki-lknr/items/db99909ba1eb27803456
1617

1718

18-
※ 2022年6月現在、WindowsでDockerを使用する際によく用いられる「Docker Desktop」は、一定の条件を満たしている場合を除いて有料です。詳しくは本資料の「参考情報」を参照してください。
19-
2019
## 参考情報
2120

2221
### Docker Desktopの料金プランについて
2322

24-
WindowsでDockerを使用する際に必要なDocker Desktopは一定の条件を満たしている場合を除き、2022年2月から有料化が予定されているとのことです(2021年9月現在)。
23+
WindowsでDockerを使用する際に必要なDocker Desktopは個人使用や教育使用などの一定の条件を満たしている場合を除き、2022年2月から有料化されています(2022年6月現在)。
24+
25+
> 4.2 Specific License Limitations – Docker Desktop.
26+
>
27+
> (a) The Docker Desktop component of the Service at the level of the Personal Offering (as described on the Pricing Page) is further restricted to: (i) your “Personal Use”, (ii) your “Educational Use”, (iii) your use for a non-commercial open source project, and (iv) your use in a “Small Business Environment”.
28+
>
29+
> (b) For purposes of this Section 4.2: (i) “Personal Use” is the use by an individual developer for personal use to develop free or paid applications, (ii) “Educational Use” is the use by members of an educational organization in a classroom learning environment for academic or research purposes or contribution to an open source project and (iii) a “Small Business Environment” is a commercial undertaking with fewer than 250 employees and less than US $10,000,000 (or equivalent local currency) in annual revenue.
30+
>
31+
> https://www.docker.com/legal/docker-subscription-service-agreement/
32+
33+
34+
#### 関連リンク
2535

2636
> Docker Desktopが有料化へ、ただし250人未満かつ年間売り上げ1000万ドル(約11億円)未満の組織や個人やオープンソースプロジェクトでは引き続き無料で利用可能
2737
> https://www.publickey1.jp/blog/21/docker_desktop250100011.html
@@ -35,6 +45,97 @@ WindowsでDockerを使用する際に必要なDocker Desktopは一定の条件
3545
* 公式のお知らせ(英語)
3646
* https://www.docker.com/blog/accelerating-new-features-in-docker-desktop/
3747

48+
> 「Docker Desktop for Linux」が登場、WindowsやMac版と同じ機能や操作を提供、Raspberry Pi OSにも対応
49+
> https://www.publickey1.jp/blog/22/docker_desktop_for_linuxwindowsmacraspberry_pi_os.html
50+
51+
* 公式のお知らせ(英語)
52+
* https://www.docker.com/blog/the-magic-of-docker-desktop-is-now-available-on-linux/
53+
54+
### WSL 2へのDockerのインストール
55+
56+
[Docker Engine](https://docs.docker.com/engine/install/)は2022年6月現在、有料化対象外です。Docker Desktopよりも機能は少ないですが、WindowsでDocker CLIをWSL 2にインストールしてDockerを使い、本教材の内容を試すこともできます。
57+
58+
#### WSL 2の設定
59+
60+
WSL 2のインストール方法についてはMicrosoftが公開する資料にまとまっています。
61+
62+
参考:https://docs.microsoft.com/ja-jp/windows/wsl/install
63+
64+
Windows 10のビルド 19041より前のバージョンでは「仮想マシンの機能の有効化」などの操作を手動で行う必要があります。
65+
66+
参考:https://docs.microsoft.com/ja-jp/windows/wsl/install-manual
67+
68+
ここではWindows 10のビルド 19041以降のバージョンの方法を紹介します。
69+
70+
PowerShellを管理者権限で開き、WSLを有効化します。
71+
72+
```
73+
wsl --install
74+
```
75+
76+
WSL 2をデフォルトバージョンに指定します。
77+
78+
```
79+
wsl --set-default-version 2
80+
```
81+
82+
Ubuntu 20.04を指定してインストールします。
83+
84+
```
85+
wsl --install -d Ubuntu-20.04
86+
```
87+
88+
![](./images/intro3-1.png)
89+
90+
正常にインストールが完了していればここで「Enter new UNIX username:」と表示されます。
91+
WSL 2の中でのみ使用するユーザ名とパスワードなので忘れないように設定します。
92+
93+
![](./images/intro3-2.png)
94+
95+
もしここで以下の図のように`0x800701bc`のエラーが出た場合は「Linux カーネル更新プログラム パッケージ」をインストールしてください。
96+
97+
https://docs.microsoft.com/ja-jp/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
98+
99+
![](./images/intro3-3.png)
100+
101+
WSL 2に無事ログインできると以下の画像のようにbashが起動します。
102+
![](./images/intro3-4.png)
103+
104+
105+
#### Dockerのインストール
106+
107+
Dockerをインストールするために必要なパッケージをインストールします。
108+
109+
```
110+
sudo apt update
111+
sudo apt install curl
112+
curl -L get.docker.com | sh
113+
sudo gpasswd -a $USER docker
114+
```
115+
116+
![](./images/intro3-5.png)
117+
118+
119+
![](./images/intro3-6.png)
120+
121+
Dockerインストール時の設定を反映させるため、Linux シェルのウインドウを一度閉じ、WSL 2を起動し直します。
122+
123+
Dockerのサービスを起動します。
124+
125+
```
126+
sudo systemctl start docker
127+
```
128+
129+
hello-worldを実行します。
130+
131+
```
132+
docker run hello-world
133+
```
134+
135+
![](./images/intro3-7.png)
136+
137+
以上でDockerのインストールと動作確認は完了です。
138+
38139
---
39140

40141
* [目次](./intro2.md)

0 commit comments

Comments
 (0)