1

我目前有一台 Hyper-V 虚拟机,其来宾操作系统是 Microsoft Server 2016

我能够安装 Docker 服务并使用命令行创建 docker 映像

我想在 Visual Studio 中使用 compose 尝试相同的过程,但它看起来只有在安装了 ToolBox 的情况下才有效。我安装了工具箱,当我构建时,我收到一个关于卷规格的错误,我相信这是因为目标操作系统是 Linux。

由于 Windows Server 2016 与 Docker for Windows 不兼容,是不是在针对 Windows Containers onc 时只能使用服务 + powerhsell,如果他们想在 Visual Studio 中使用 Compose,我将不得不在内部禁用 hyper-visor并确保 Linux VM 正在运行?

我对 Windows Server + VS 与 Docker 的工作流程有点困惑。感谢您的任何澄清。

编辑:

我卸载了 ToolBox 以简化环境,我以这种方式下载了 compose:

Invoke-WebRequest " https://github.com/docker/compose/releases/download/1.15.0-rc1/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe

现在构建错误是:

 ERROR: for dockercompose1517717654_azurecontainersite_1  __init__() got an 
 unexpected keyword argument 'cpu_count'
 ERROR: for azurecontainersite  __init__() got an unexpected keyword 
 argument 'cpu_count'
 Traceback (most recent call last):
 File "docker-compose", line 3, in <module>
 File "compose\cli\main.py", line 68, in main
 File "compose\cli\main.py", line 118, in perform_command
 File "compose\cli\main.py", line 926, in up
 File "compose\project.py", line 424, in up
 File "compose\parallel.py", line 69, in parallel_execute
 TypeError: __init__() got an unexpected keyword argument 'cpu_count'
 Failed to execute script docker-compose.
4

1 回答 1

0

目前 Visual Studio 工具仅支持 Linux 容器。如果/当这种情况发生变化时,我会更新这个答案。

为了让 VS with Compose 在 Server 2016 上运行,我使用以下链接安装了适用于 Windows 的 Docker 边缘版本:

https://store.docker.com/editions/community/docker-ce-desktop-windows

于 2017-07-19T16:58:32.493 回答