microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.2k stars 514 forks source link

Support rootless, daemonless podman inside WSL #3241

Open Clockwork-Muse opened 3 years ago

Clockwork-Muse commented 3 years ago

Since the changes to Docker's licensing, I've been looking at using Podman to run my devcontainers instead of Docker. There's a couple of wrinkles to this, however; by default Podman is daemonless, and doesn't have a running service. This is actually a benefit to running in WSL (which doesn't have systemd by default), but means that accessing it via a remote CLI requires setting up a bunch of other services.

My preferred setup would be;

... and have everything "just work" (ie, container and image list).

The remote-containers extension solved this by running cli commands inside WSL.

PavelSosin-320 commented 2 years ago

There are many benefits in using rootless Podman but not listed above:

  1. Podman is serverless but not serviceless. Podman service can be started as systemd service. It can run every container as a service root or rootless.
  2. Systemd is a part of most Linux distros supported by Podman.WSL doesn't use systemd as a init system but the ways to do it exist: systemd-genie from Arkane system.
  3. Podman is the CLI toolset that consists of Podman, Buildah, and Skopeo packages that speed up Image development.
  4. It is not scalable - using one Podman by several users in parallel is hardly possible. Every regular Linux desktop GUI or remote user has all resources available for his/her user session unless the container uses the system resources available only to root.
  5. Podman remote client and Docker client have many common features but the key features used in the development are completely different. Service point configuration is different.
  6. Podman REST API extends Docker REST API but they are not equivalent. It doesn't ensure that Docker's client will work exactly in the same way with Podman and Docker including storage, networking, SSH support, port forwarding via docker-proxy, etc. Podman offers a very fast and convenient but very minimalistic runtime with a focus on image and pod development.
bwateratmsft commented 2 years ago

I think we will need to work on as generic a solution as possible given the variety of container runtimes possible.

bwateratmsft commented 2 years ago

Probably related to #3263.

jankap commented 2 years ago

Is there any chance to just run commands in WSL, as it's possible with the remote-containers extension, too?

image

bwateratmsft commented 2 years ago

@jankap You may find some success with the docker.dockerPath setting, e.g. setting it to something like "\"wsl -- docker\"", but I'm not completely sure. It is something we are actively working on.

sd37 commented 1 year ago

whats the status on this. I am still trying to get the docker extension work with podman on windows ?

gudge25 commented 1 year ago

+

nqdrizzt commented 11 months ago

is there any update on this ?

the last docker extension working with podman for me is v1.22.2. I have to downgrade to this version to keep podman working

I am running the latest podman version version 4.5.1 within the wsl2

chenwei791129 commented 11 months ago

My podman version is 4.7.1 also got same issue, need downgrade to docker extension v1.22.2

FancyBanana commented 10 months ago

Can confirm that the issue is still present and only reverting to v1.22.2 works

nqdrizzt commented 10 months ago

I can confirm that podman in wsl2 with debian bookworm is only running on docker extension 1.22.2 and below.

podman version Client: Podman Engine Version: 4.5.1 API Version: 4.5.1 Go Version: go1.19.8 Built: Thu Jan 1 01:00:00 1970 OS/Arch: linux/amd64

vscode on nightly build

godefroi commented 8 months ago

Still an issue Jan 2024. Downgrading to extension version 1.22.2 works.

godefroi commented 8 months ago

@jankap You may find some success with the docker.dockerPath setting, e.g. setting it to something like "\"wsl -- docker\"", but I'm not completely sure. It is something we are actively working on.

I tried setting docker.dockerPath to \"wsl --distribution podman-machine-default -- docker\" but the extension simply told me that Docker wasn't installed and I got the "unable to connect" messages in the container/image lists

mash-graz commented 7 months ago

It is a pity that this problem is still not solved and we have to use an outdated version of the plugin.

fiveisprime commented 7 months ago

Hey everybody, I know there's some excitement around this, so I wanted to give a quick update to set expectations. This work is in the current milestone; however, some high priority tasks have come up which have redirected the engineering team so it will be a while still before it ships.

I just wanted you all to know that we hear how important this is and we'll have a solution as soon as we can. I'll keep this issue updated as we make progress.

t40mas commented 4 months ago

One question is why other clients can handle podman. E.g. IntelliJ, lazydocker or the docker raycast extension. These tools working well, even with the podman 5 api. This cannot just be due to invalid JSON ☺️ The raycast extension uses dockerode, this seems really straightforward.

DevDorrejo commented 3 months ago

So, is impossible to use with podman?

I am in openSUSE Tumbleweed, using VSCode latest with latest Docker extension, with Podman:

Client:       Podman Engine
Version:      5.1.1
API Version:  5.1.1
Go Version:   go1.21.11
Built:        Wed Jun  5 01:24:29 2024
OS/Arch:      linux/amd64

not matter the docker extension version, I am getting JSON error.

realsircodesalot commented 3 months ago

🤞🏼 It works great w/ Podman on macOS. I just wish I could have the same experience on Windows.

tony-sol commented 3 months ago

For me, on macos, it's not working with podman.sock link to /var/run/docker.sock, only with docker itself or with limactl vm

Clockwork-Muse commented 1 month ago

Note that since I first posted this issue, Podman Desktop has come out/matured, and I'm looking at switching to it. In that case, interfacing with the Podman Desktop distro would be helpful...

gliptak commented 2 weeks ago

https://podman-desktop.io/docs/installation