I am learning docker and containers. I am trying to Publish my .Net Core 3.1 Web App on Docker Hub via visual studio 2019. I am on Windows PC, But the visual studio deployment environment is set to Linux and Docker also set to Linux. I have installed WSL2 (Windows subsystem for linux 2) as well. Also the Web app is executing well and at the same time I can see the container and image is created into Docker dashboard (running) successfully. However, while trying to publish it on Docker Hub, I am getting below error.
Can you help me out that which part is missing on my PC (it is azure windows 10 VM)?
Note: I am able to run linux containers as well without any issue. Also Ubuntu 20 is installed from Windows Shop.
2021-07-01 10:19:58 AM
Microsoft.WebTools.Azure.Publish.Docker.DockerCommandException: Running the docker.exe tag command failed.
Current context "desktop-linux" is not found on the file system, please check your config file at C:\Users\kulkarnis009\AppData\Local\Temp\7961a412d485473395194d8ad39fe785\config.json
at Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.ThrowDockerCommandError(String dockerCommand)
at Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.<DockerTagAsync>d__3.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.WebTools.Azure.Publish.Docker.DockerPublish.<DockerPublishAsync>d__2.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.WebTools.Azure.Publish.ContainerRegistry.ManageContainerRegistry.<PushImageAsync>d__11.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.WebTools.Azure.Publish.PublishProviders.ContainerRegistryProfileVisual.<PostPublishAsync>d__38.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.Publish.Framework.Nexus.PublishProfilesServiceImpl.ServerProjectProfilesManager.<RunPublishTaskAsync>d__53.MoveNext()
===================
To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).
NET Framework application must run on Windows, period. If you want to containerize existing . NET Framework applications and you can't or don't want to invest in a migration to . NET Core or later("If it works properly, don't migrate it"), the only choice you have for containers is to use Windows Containers.
in the file
file:///C:/Users/UserName/AppData/Local/Temp/c69e796a148440f18675b80111e06796/config.json
Change desktop-linux
{
"auths": {},
"credsStore": "desktop",
"currentContext": "default",
"stackOrchestrator": "swarm",
"HttpHeaders": {
"X-Meta-Source-Client": "vs/web/publish"
}
}
currentContext had desktop-linux, I just put "default"
I had the same issue and I was was able to resolve by switching the docker context back to default (it was set to desktop-linux) using the command:
docker context use default
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With