Windows Docker 容器無法存取網際網路

Windows Docker 容器無法存取網際網路

我在 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 更新。

相關內容