顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== (Windows Subsystem for Linux)WSL 相關議題整理 ====== ====Q1. 在 wsl 內啟動的容器無法連上 Internet ==== - 確保 WSL 網絡設置正確: 在 Windows PowerShell 中運行以下命令來檢查和重置 WSL 網絡:<cli> wsl --shutdown netsh winsock reset netsh int ip reset all netsh winhttp reset proxy ipconfig /flushdns </cli> - 確認 docker-compose.yml 內網路的設置是否正確, 也可試試加上 network_mode: "bridge" Exp.<file> : services: your_service: network_mode: "bridge" </file>或是 network_mode: "host" Exp.<file> : services: your_service: network_mode: "host" </file> ====Q2. 設定 wsl 內啟動的 Ubuntu 22.04 容器使用與 Windows Host 相同的 DNS ==== - 在 Ubuntu 22.04 的 /etc/wsl 設定檔內加入 <file> [network] generateResolvConf = true </file> - 在 Windows Host 的 Powershell 內重新啟動 wsl <cli> wsl --shutdown </cli> {{tag>wsl}} tech/wsl_network.txt 上一次變更: 2024/12/22 09:32由 jonathan