# WSL (Windows Subsystem for Linux) + Docker ###### tags: `Docker` `WSL` ## SOP ### 允許Hyper-V + 安裝WSL 1. 控制台 => 程式集 => 程式和功能 => 開啟或關閉Windows功能  2. 適用於Linux的Windows子系統 => 打勾  3. Hyper-V => 打勾  4. 重開機 ### 更新至WSL2並將其設為預設 5. 到以下連結下載wsl_update_x64.msi並且執行安裝 https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi 6. 使用使用者權限打開powershell後並且下指令將WSL2設為預設 ```javascript= wsl --set-default-version 2 ``` ### 安裝docker desktop 7. 到以下連結下載docker windows並且執行安裝 https://hub.docker.com/editions/community/docker-ce-desktop-windows/ 8. 安裝時把能打勾的全打勾 9. 安裝完docker後進去設定頁面,將Use the WSL 2 based engine打勾  10. 進去設定頁面,將Use the WSL 2 based engine打勾  ### 安裝Windows Terminal 11. 到以下連結取得並安裝Windows Terminal https://www.microsoft.com/zh-tw/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab ### 執行docker container 12. 使用管理者權限打開Windows Terminal 13. 即可在Windows Terminal下docker指令運行docker ## 參考資料 1. https://medium.com/@misscoming/%E5%9C%A8-windows-10-%E4%B8%8A%E8%B7%91-ubuntu-18-04-92f80b2d725b 2. https://marcus116.blogspot.com/2019/02/chocolatey-windows-chocolatey.html 3. https://dev.to/kapilgorve/move-install-wsl-distro-from-c-drive-to-another-drive-19g9 4. https://medium.com/%E4%B8%80%E5%80%8B%E5%B0%8F%E5%B0%8F%E5%B7%A5%E7%A8%8B%E5%B8%AB%E7%9A%84%E9%9A%A8%E6%89%8B%E7%AD%86%E8%A8%98/wsl-%E8%88%87-windows-%E7%9A%84%E5%AE%8C%E7%BE%8E%E9%9B%99%E7%B5%90%E5%90%88-%E5%9C%A8wsl-%E4%B8%AD%E5%AE%89%E8%A3%9D-docker-e722e87ffa3b 5. https://docs.microsoft.com/zh-tw/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package 6. https://www.cnblogs.com/xhznl/p/13184398.html 7. https://samkuo.me/post/2020/04/dev-env-docker-wsl2-k3d-vs-code/ 8. https://www.microsoft.com/zh-tw/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.