问题
I currently have a Hyper-V Virtual machine whose guest OS is Microsoft Server 2016
I was able to install the Docker Service and use the command line to create a docker image
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.
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?
I am a little confused on the workflow regarding windows server + VS with Docker. Thanks for any clarification.
EDIT:
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
And now the build error is:
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.
回答1:
At this time Visual Studio tools only support Linux Containers. If/when that changes I will update this answer.
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
来源:https://stackoverflow.com/questions/45173859/using-docker-and-compose-in-hyper-v-with-windows-server-2016