Kelvin Low
Kelvin Low

Reputation: 400

.NET to Docker Hub built success but publish failed

I am trying to publish my .NET Core project to Docker Hub with Visual Studio 2017.

Right click for Publish

Next, I select Docker Hub & type my credential on the next step.

enter image description here

This project has been built successfully but failed to publish. Here is my output.

docker build -t "netcore" -f "Dockerfile" --label "com.microsoft.created-by=visual-studio" ".."
Sending build context to Docker daemon  3.936MB

Step 1/19 : FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803 AS base
2.2-aspnetcore-runtime-nanoserver-1803: Pulling from microsoft/dotnet
e46172273a4e: Pulling fs layer
68aae72b77f3: Pulling fs layer
61f30f9e4e83: Pulling fs layer
e15c123b212e: Pulling fs layer
021eb2251d67: Pulling fs layer
dc7ca004e96c: Pulling fs layer
ecedf99e17d3: Pulling fs layer
e15c123b212e: Waiting
021eb2251d67: Waiting
dc7ca004e96c: Waiting
ecedf99e17d3: Waiting
image operating system "windows" cannot be used on this platform
C:\Users\kelvin\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.0.2105168\build\Container.targets(159,5): 
Error MSB3073: The command "docker build -t "netcore" -f "Dockerfile" --label "com.microsoft.created-by=visual-studio" ".."" exited with code 1.
2>Build failed. Check the Output window for more details.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

Does anyone has solution for this please?

Upvotes: 0

Views: 635

Answers (1)

Kelvin Low
Kelvin Low

Reputation: 400

While using Docker Toolbox, 'Linux' must be selected when creating VSProject. enter image description here

Upvotes: 1

Related Questions