如何在 Linux 上的 Windows 虛擬機器上執行 docker

如何在 Linux 上的 Windows 虛擬機器上執行 docker

這是我的情況:我正在一台 Linux 機器(Linux Mint 18.2)上使用 .NET Core 進行工作。一個特定專案需要使用 .NET Framework,因此我使用 VirtualBox 啟動了一台 Windows 10 虛擬機器。現在我需要將此應用程式打包到 docker 容器中。我嘗試在Windows VM上安裝docker,但在啟動守護程序時總是出現錯誤,並且在執行docker build時出現此錯誤:

error during connect: Post 
open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

我的問題是,這可能嗎?是否有一些配置可以讓 docker 在 Windows 虛擬機器上運行,或者我是否需要在獨立系統上運行?

答案1

像往常一樣,我在發布此內容後立即就明白了這一點。 Windows 上的 Docker 預設使用 Linux 容器,這導致了錯誤。切換到 Windows 容器後一切正常。

相關內容