使用Vs2017 编译 eShopOnContainers-ServicesAndWebApps 时,报了错误:
Microsoft.DotNet.Docker.CommandLineClientException: client version 1.22 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version.
For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting ---> Microsoft.DotNet.Docker.CommandLineClientException: client version 1.22 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.DotNet.Docker.DockerComposeClient.<ExecuteAsync>d__18.MoveNext() --- End of inner exception stack trace --- at Microsoft.DotNet.Docker.DockerComposeClient.<ExecuteAsync>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.DotNet.Docker.DockerComposeClient.<DownAsync>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.DotNet.Docker.DockerWorkspace.<PrepareForLaunchAsync>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.DotNet.Docker.BuildTasks.DockerBaseTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.Compose.targets 192
Visual studio 2017 给出的解决方案并不对,正确的操作方式如下:
首先使用docker-compose version
看下具体的版本信息,我的windows server 2016 服务器的信息如下:
C:\Users\geffzhang>docker-compose version docker-compose version 1.14.0, build c7bdf9e3 docker-py version: 2.3.0 CPython version: 2.7.13 OpenSSL version: OpenSSL 1.0.2j 26 Sep 2016
把下面的文件的Vesion 从2 改成3 就可以了,https://docs.docker.com/compose/compose-file/
docker-compose.ci.build.yml docker-compose.yml