-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve docker context 'desktop-linux' with VisualStudio 2022 and Docker Desktop v4.34.0 #14295
Comments
We are getting the same error here ... It first manifested in our jenkins pipeline but confirmed it also happens in Visual Studio 2022. |
We are not getting this error anymore ... not sure why. |
Based on the location it's trying to look for the context;
I suspect this is an issue with Visual Studio's Docker integration. ISTR that the Visual Studio integration did some trickery to patch the CLI config with some additional options; basically this was something like;
The CLI configuration will contain the name of the currently selected docker context ("desktop-linux" in this case), which is kept in the copy of the config file. ISTR Visual Studio had to set some custom headers (for which they had to create the copy), and for which I added an alternative; docker/cli#5098 but I don't think they're using that currently. The other alternative is to override the context to be "default" (which can be done through an ISTR they were considering (or have implement) that last option, but not sure what release of Visual Studio that was included in. |
Thank you for looking into this. I am facing the exact same issue when publishing docker images from Visual Studio. |
Updating Docker Desktop to 4.34.2 and Visual Studio to 17.11.4 got me around this issue. |
Thanks! Updating Visual Studio worked for me as well 👍 |
Description
In an attempt to resolve this problem, I have looked at similar issues to this from 3 years ago - it looks to me like the issuer persists.
In VisualStudio 2022 I create a simple ASP.Next Core API appl - it uses the default demo API generated by VS.
With Desktop Docker v4.34.0 installed it will run fine in a docker container locally.
When I try to publish from VS I see
Failed to initialize: unable to resolve docker endpoint: context "desktop-linux": context not found: open
I have tried switching the context in Docker Desktop but still produced this error.
Reproduce
Run the Publish feature in VS 2022
Expected behavior
No response
docker version
Client: Version: 27.2.0 API version: 1.47 Go version: go1.21.13 Git commit: 3ab4256 Built: Tue Aug 27 14:17:17 2024 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.34.0 (165256) Engine: Version: 27.2.0 API version: 1.47 (minimum version 1.24) Go version: go1.21.13 Git commit: 3ab5c7d Built: Tue Aug 27 14:15:15 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.20 GitCommit: 8fc6bcff51318944179630522a095cc9dbf9f353 runc: Version: 1.1.13 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Diagnostics ID
1212
Additional Info
No response
The text was updated successfully, but these errors were encountered: