This is a brief post because it’s the second time I’ve had to resolve the same issue and as I don’t think my memory is getting any better, it’s probably better this goes down on my permanent record. 😉
I love those rabbit holes that you don’t see coming until too late. I had offered to assist with some Docker investigations for another Technical Evangelist at Microsoft. In order to do that I needed to take a currently functional ASP.NET Core site and add docker support.
So easy… Right click to win…
After Visual Studio added the DockerFile and the Docker-Compose scripts, I clicked on the Continuous Delivery Extension and configured the release to deploy using an Azure App Service for Linux. The resulting build would submit a Docker Image to my Azure Container Registry and the Azure App Service for Linux would host this as content. This approach is really attractive as we benefit from the enhanced DevOps story as well as benefiting from features such as SSL termination and App Settings integration.
The extension usually performs a rapid job of created the App Service, generated a .NET Core build and provisioned a release to to the App Service.
To my disappointment, my first build instead resulted in the following error:
2017-11-07T08:01:53.4574767Z Creating network “devrisecontainer_default” with the default driver2017-11-07T08:01:53.5054822Z HNS failed with error : The parameter is incorrect.2017-11-07T08:01:53.5434806Z ##[error]Creating network “devrisecontainer_default” with the default driver
After a bit of messing around I figured out the agent was configured to VS2017 so I set it back to Hosted Linux Preview and kicked off the build again.
The build failed again with a different error:
Creating network “devrisecontainer_default” with the default driver2017-11-07T07:32:17.4058490Z Pulling ci-build (microsoft/aspnetcore-build:1.0-1.1)…2017-11-07T07:32:20.2100030Z 1.0-1.1: Pulling from microsoft/aspnetcore-build2017-11-07T07:33:43.1627390Z Digest: sha256:552e6960be0568f0932536292402753595b8891fe88cf1d4d4a79893fc2806262017-11-07T07:33:43.1836080Z Status: Downloaded newer image for microsoft/aspnetcore-build:1.0-1.12017-11-07T07:33:43.1941150Z Creating devrisecontainer_ci-build_1 …/usr/share/dotnet/sdk/1.1.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.TargetFrameworkInference.targets(112,5): error : The current .NET SDK does not support targeting .NET Core 2.0. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.0. [/src/DevRiseContainer/DevRise.csproj]2017-11-07T07:34:05.9935840Z [36mdevrisecontainer_ci-build_1 exited with code 12017-11-07T07:34:06.0031290Z [0mAborting on container exit…2017-11-07T07:34:06.0478380Z ##[error]Creating network “devrisecontainer_default” with the default driver
2017-11-07T08:06:17.1518550Z Status: Downloaded newer image for microsoft/aspnetcore:2.02017-11-07T08:06:17.1637510Z Creating devrisecontainer_ci-build_1 …2017-11-07T08:06:17.8816870Z [36mci-build_1 |[0m Did you mean to run dotnet SDK commands? Please install dotnet SDK from:2017-11-07T08:06:17.8858550Z [36mci-build_1 |[0m http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x4092017-11-07T08:06:18.1457110Z [36mdevrisecontainer_ci-build_1 exited with code 1452017-11-07T08:06:18.1593110Z [0mAborting on container exit…2017-11-07T08:06:18.2085250Z ##[error]Creating network “devrisecontainer_default” with the default driver2017-11-07T08:06:18.2155070Z ##[error]Pulling ci-build (microsoft/aspnetcore:2.0)…2017-11-07T08:06:18.2231220Z ##[error]Creating devrisecontainer_ci-build_1 …
2017-11-07T08:18:20.6302930Z [36mci-build_1 |[0m /src/docker-compose.dcproj : error MSB4236: The SDK ‘Microsoft.Docker.Sdk’ specified could not be found.2017-11-07T08:18:27.9507650Z [36mci-build_1 |[0m DevRise -> /src/DevRiseContainer/bin/Release/netcoreapp2.0/DevRise.dll2017-11-07T08:18:32.4244890Z [36mci-build_1 |[0m DevRise -> /src/DevRiseContainer/obj/Docker/publish/2017-11-07T08:18:33.0920570Z [36mdevrisecontainer_ci-build_1 exited with code 12017-11-07T08:18:33.1045510Z [0mAborting on container exit…2017-11-07T08:18:33.1606200Z ##[error]Creating network “devrisecontainer_default” with the default driver

