After rebooting my laptop, I can no longer public to Azure Container Registry. Happened last 4 times I rebooted

Hello,

The last 4 times I have rebooted my computer, I can no longer publish to Azure Container Registry after the reboot. I’ve been publishing to the very same container over a 3 year period without issue until last week. The only way I’ve been able to fix it is to uninstall docker desktop for Windows then re-install. Does anyone have a fix for this? Thank you in advance.

Failed to initialize: unable to resolve docker endpoint: context “desktop-linux”: context not found: open C:\Users\redacted\AppData\Local\Temp\7408f398aca84b7c91689515caf11602\contexts\meta\fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e\meta.json: The system cannot find the path specified.

A diagnostic log has been written to the following location:
“C:\Users\redacted\AppData\Local\Temp\tmpE9A1.tmp” (contents of the file is below)

6/17/2024 10:12:58 AM
Microsoft.WebTools.Azure.Publish.Docker.DockerCommandException: Running the docker.exe tag command failed.

Failed to initialize: unable to resolve docker endpoint: context “desktop-linux”: context not found: open C:\Users\redacted\AppData\Local\Temp\7408f398aca84b7c91689515caf11602\contexts\meta\fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e\meta.json: The system cannot find the path specified.
at Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.ThrowDockerCommandError(String dockerCommand, StringBuilder errorOutput)
at Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.d__6.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.WebTools.Azure.Publish.Docker.DockerPublish.d__3.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.WebTools.Azure.Publish.ContainerRegistry.ManageContainerRegistry.d__13.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.WebTools.Azure.Publish.NewFx.Profiles.ContainerPushPublishStep.d__11.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Publish.Framework.Profiles.ProjectProfilesManager.d__44.MoveNext()

1 Like

Reinstall did not fixed the issue for me, so workaround for me is to push it manually

docker build -t image-name .
docker tag image-name <your_registry_name>.azurecr.io/image-name:tag
docker push <your_registry_name>.azurecr.io/image-name:tag

I found this problem only with Visual Studio, but VS Code still working.

I experience exactly the same issue and it generates the same log for me. This happens with any project when publishing in Visual Studio, even in its latest version. I ended up using the CLI.

I was trying to upload two .NET projects to the registry, one in .NET 7.0 and the other in .NET 8.0.

I re-installed again yesterday after facing the same issue. Only this time, I did not install the updates yes. I’ve rebooted and cleaned all my temporary files and it’s still working fine. So it may be the docker update causing this. I also updated Visual Studio yesterday after notification of VS updates.

Same problem here.

I assume you’re referring to VS updates? What version are you on?

I have latest version of patches for VS 2022 but I think it’s the docker update. What fixed it for me was setting the default context to the default. The issue is I have to run this command after I start docker desktop. docker context use default. Annoying

NAME DESCRIPTION DOCKER ENDPOINT ERROR
default * Current DOCKER_HOST based configuration npipe:////./pipe/docker_engine
desktop-linux Docker Desktop npipe:////./pipe/dockerDesktopLinuxEngine