- ติดตั้ง WSL 2
- ติดตั้ง .NET Core SDK
- สร้างโปรเจ็กส์ webapp
- เรียกเว็บจาก Windows
- เก็บ code ด้วย local git
Tag Archives: WSL2
ติดตั้ง Docker Desktop WSL 2
Prerequisites
- อัพเดท Windows 10 ให้เป็นเวอร์ชัน 1909 (build 18363)
- เปิด Windows Insider Program Settings แล้วเลือก Fast (Windows 10 Insider Preview build 19018 or higher).
- ติดตั้ง WSL 2
Download
- Download Docker Desktop Edge 2.1.6.0 or a later release.
Install
- ติดตั้ง
Docker Desktop Installer.exe
ที่ download มา - ที่ System tray ด้านล่างขวาของหน้าจอ ให้คลิกขวาที่ Docker เลือก Settings > General.

- เลือก Enable the experimental WSL 2 based engine
- กด Apply & Restart
- เมื่อ Docker Desktop รีสตาร์ทเสร็จ, เลือก Settings > Resources > WSL Integration แล้วเลือก WSL 2 distributions (เช่น Ubuntu-18.04)

- กด Apply & Restart
ตรวจสอบการติดตั้ง
ดูเวอร์ชัน
> docker --version Docker version 19.03.5, build 633a0ea
ดูเวอร์ชันแบบละเอียด
> docker version Client: Docker Engine - Community Version: 19.03.5 API version: 1.40 Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:22:37 2019 OS/Arch: windows/amd64 Experimental: true Server: Docker Engine - Community Engine: Version: 19.03.5 API version: 1.40 (minimum version 1.12) Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:29:19 2019 OS/Arch: linux/amd64 Experimental: true containerd: Version: v1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683
Link
ติดตั้ง WSL 2
ดู doc ที่ aka.ms/wsl2
ขั้นตอนการติดตั้ง WSL 2
1.update Windows ให้เป็นเวอร์ชันล่าสุด (1909) , ตรวจสอบเวอร์ชันด้วยคำสั่ง winver
2.เปิด Windows Insider Program Settings แล้วเลือก Fast

3.เปิด Turn Windows features on or off เลือก Windows Subsystem for Linux และ Virtual Machine Platform

4.เปิด Microsoft Store เลือกติดตั้ง Ubuntu 18.04

หลังจากติดตั้งเสร็จ จะให้เราตั้ง username และ password
5.เปิด Power Shell
list ดู Distro ที่ติดตั้ง
> wsl -l Windows Subsystem for Linux Distributions: Ubuntu-18.04 (Default)
กำหนดให้ Ubuntu-18.04 ที่พึ่งติดตั้ง ใช้ WSL 2
> wsl --set-version Ubuntu-18.04 2
กำหนดให้ default เป็นเวอร์ชัน 2 เลย
> wsl --set-default-version 2
ตรวจสอบดูว่าเป็น version 2 แล้วหรือยัง
> wsl -l -v NAME STATE VERSION * Ubuntu-18.04 Stopped 2
ถ้ารันแล้วไม่เจอคำสั่ง -v แสดงว่ายังเป็น WSL 1
6.กลับมาที่ app Ubuntu18.04 แล้วลองเรียก VS Code
> wsl -d Ubuntu-18.04
หรือ

$ code .