![Windows Docker 容器無法存取網際網路](https://rvso.com/image/1585762/Windows%20Docker%20%E5%AE%B9%E5%99%A8%E7%84%A1%E6%B3%95%E5%AD%98%E5%8F%96%E7%B6%B2%E9%9A%9B%E7%B6%B2%E8%B7%AF.png)
我在 Windows 10 電腦上運行。我安裝了適用於 Windows 的 Docker,並在 Windows 功能中啟用了容器和 Hyper-V。 BIOS 中啟用了虛擬化。
當我運行時,docker run mcr.microsoft.com/windows/nanoserver ping google.com
我收到以下資訊:
Ping request could not find host google.com. Please check the name and try again.
當我運行時docker run mcr.microsoft.com/windows/nanoserver ping 8.8.8.8
,我得到以下信息:
Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Reply from 172.18.81.109: Destination host unreachable.
Request timed out.
Request timed out.
Ping statistics for 8.8.8.8:
Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),
如果我從主機上運行其中任何一個,它們都會正常工作。
我在這裡運行了調試腳本:https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/live/windows-server-container-tools/Debug-ContainerHost所有測試都通過了。
知道為什麼我的容器無法路由到外部網路嗎?
答案1
這是一個非常令人不滿意的答案,但在安裝了所有 Windows 更新、卸載 Docker、停用/重新啟用 Hyper V 和容器以及重新安裝 Docker 後,我得到了它的工作。
據我所知,這是缺少 Windows 更新。