Open hansmbakker opened 1 year ago
You can use podman machine inspect --format '{{.ConnectionInfo.PodmanPipe.Path}}'
ConnectionInfo.PodmanSocket.Path
is reserved for QEMU and other providers and uses UNIX sockets on supported OS (including Windows), but for using named pipe there is a separate property, because it is different transport protocol.
Background, this decision was introduced, because while Podman machine could optionally support both types, but the Podman Desktop on Windows can operate only with named pipe due to libuv limitations. So, for machine providers, which support real socket they would also need to support named pipe for Podman Desktop compatibility.
The documentation in Podman Desktop is wrong. Code part responsible for retrieving path of the pipe https://github.com/containers/podman-desktop/blob/4eca4d670efbdcbaea9443f25833eff08a572bb5/extensions/podman/src/extension.ts#L161
The documentation in Podman Desktop is wrong. Code part responsible for retrieving path of the pipe https://github.com/containers/podman-desktop/blob/4eca4d670efbdcbaea9443f25833eff08a572bb5/extensions/podman/src/extension.ts#L161
Ok, then I get the pipe but not the socket - will that allow me to set the DOCKER_HOST
env var in such a way that it allows for transparent migration from Docker? (and use the VS Code Docker extension, which relies on that env var)
@hansmbakker It should work as Docker API on Windows was exposed via named pipe last time I checked it.
Will try that, thank you!
Ok - I tried setting the DOCKER_HOST
env var to \\.\pipe\podman-machine-default
and I set the path to the docker executable to podman
but the extension keeps saying it failed to connect. Does anybody have a suggestion?
Besides this extension, podman works fine for the DevContainers extension using podman
as a value for the path to the docker executable. The DevContainers extension does not rely on the DOCKER_HOST
environment variable.
Here's a fix for the documentation: https://github.com/containers/podman-desktop/pull/4157
You need to prefix the pipe with npipe://
when putting it in the DOCKER_HOST
environment variable. Also note, you don't actually need to change the DOCKER_HOST
at all if you're on windows. Podman also listens on the docker_engine
named pipe that most tools should default to using.https://github.com/containers/podman/blob/cc8c28eb7c0c336931b9bf5879ff454818519c94/docs/tutorials/podman-for-windows.md?plain=1#L109-L111
A friendly reminder that this issue had no activity for 30 days.
Thank you for the suggested fixes! I tried setting DOCKER_HOST
to npipe:////./pipe/docker_engine
but unfortunately it did not help. The UI says
Failed to connect. Is Docker running? Error: Invalid image JSON
TheDocker
output window stays empty (no logging or stack traces), and other output windows do not mention anything either.
My environment:
Is this still unresolved? im pretty much in the same situation, Cant connect to the npipe from vs code on windows
Seeing same issue on my environment OS: Win10 VS Code: 1.84.2 Podman: 4.8.1
Have tried all the fixes set out above but still seeing the "Failed to connect. Is Docker installed?" message. As with everyone else here mentioning the issue I too am in the process of moving from Docker to Podman
Same issue over here ... trying to replace docker with podman but cannot connect VS Code to Podman..
The same problem. with VS Code.
@StanEgo @dbiegunski @Zak-Ghani @hansmbakker This extension is known to have issues with Podman. Could you test with the extension version downgraded to 1.22.x as workaround? I checked in a test clean system and it worked with 1.22.2
Here is related ticket https://github.com/containers/podman/issues/17306 And there are numerous tickets in bug tracker of the extension. I'm not a representative of either MS or Podman development team, so, I can't say who should be responsible to fix this.
Currently there is two options available to use podman containers within VS Code.
Use Docker extention version 1.22.2 or below. From version 1.23.0+, the extention has switched from HTTP API based communication with the deamon to CLI based which is creating an compatibility issue between the podman & docker with the command returned keys. For example Id
vs ID
Use Pod Manager. A new extention has created by @dreamcatcher45. It is working fine with podman containers. [https://marketplace.visualstudio.com/items?itemName=dreamcatcher45.podmanager&ssr=false#overview](https://github.com/containers/podman/issues/url)
Issue Description
This documentation page says to run
podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}'
to get the socket path.However, that results in:
Just running
podman machine inspect
shows (I trimmed the output to the relevantConnectionInfo
section:Steps to reproduce the issue
Steps to reproduce the issue
winget install RedHat.Podman
winget install RedHat.Podman-Desktop
podman run quay.io/podman/hello
to verify podman workspodman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}'
Describe the results you received
Error: template: inspect:1:29: executing "inspect" at <.ConnectionInfo.PodmanSocket.Path>: nil pointer evaluating *machine.VMFile.Path
Describe the results you expected
A socket path
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Windows desktop (Windows 11 build 22621.2215)
Additional information
No response