在Windows Server 2016的Hyper-V中使用Docker和Compose [英] Using Docker and Compose in Hyper-V with Windows Server 2016
问题描述
我目前有一个Hyper-V虚拟机,其来宾操作系统为Microsoft Server 2016
I currently have a Hyper-V Virtual machine whose guest OS is Microsoft Server 2016
我能够安装Docker Service并使用命令行创建Docker映像
I was able to install the Docker Service and use the command line to create a docker image
我想使用compose在Visual Studio中尝试相同的过程,但是看起来只有在安装了ToolBox的情况下,该过程才起作用.我安装了工具箱,并且在构建时遇到有关体积规格的错误,我相信这是因为目标操作系统是Linux.
I would like to try the same process out in Visual Studio using compose, but it looks like that will only work if the ToolBox is installed. I installed the Toolbox and when I build I get an error around the volume spec, I believe this is because the target OS is Linux.
由于Windows Server 2016与Windows的Docker不兼容,是否是在针对Windows容器时onc只能使用服务+ powerhsell,并且如果他们想在Visual Studio中使用Compose,则必须禁用超级-visor内部并确保Linux VM正在运行?
Since Windows Server 2016 is not compatible with Docker for Windows, is it the case that when targeting Windows Containers onc can only use the service + powerhsell, and if they want to use Compose in Visual Studio I would have to disable the hyper-visor internally and make sure the Linux VM is running?
我对Windows Server + VS与Docker的工作流程有些困惑.感谢您的澄清.
I am a little confused on the workflow regarding windows server + VS with Docker. Thanks for any clarification.
我卸载了ToolBox来简化环境,我下载了这种方式:
I uninstalled the ToolBox to simplify the environment, I downloaded compose this way:
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.
推荐答案
目前,Visual Studio工具仅支持Linux容器.如果/何时更改,我将更新此答案.
At this time Visual Studio tools only support Linux Containers. If/when that changes I will update this answer.
为了使VS with Compose在Server 2016上运行,我还通过以下链接安装了Windows的边缘版本Docker:
Also to get VS with Compose to work on Server 2016, I installed the edge version of Docker for Windows with the following link:
https://store.docker.com/editions/community/docker-ce-desktop-windows
这篇关于在Windows Server 2016的Hyper-V中使用Docker和Compose的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!