vscode-docker icon indicating copy to clipboard operation
vscode-docker copied to clipboard

No containers/images/etc. listed in extension when docker is installed via snap package

Open danegsta opened this issue 2 years ago • 7 comments

We've received a number of different reports recently of a particular bug on Linux systems that results in the Docker extension not showing any containers, images, etc. despite seeing one or more results when enumerating resources with the Docker CLI from the terminal. We've tracked down what we believe to be the most common root cause of the issue to the snap application sandbox blocking access to some resources when a snap install of Docker is called from a snap install of VSCode.

We're still investigating what would be required to fix this issue (or if it's something that would require an external fix somewhere like the Docker snap package itself), but we've identified a manual workaround that should unblock users of the extension. If you update the Docker Path property in your VSCode settings to /snap/docker/current/bin/docker the extension should start listing resources correctly again. If you see any errors after updating the Docker Path property, please double check that you installed Docker via snap and that it installed the Docker snap resources to the default path.

danegsta avatar Feb 23 '23 22:02 danegsta

was facing the same challenge,but hope here after,my journey towards my career development gonna flourish.

chardso avatar Sep 26 '23 23:09 chardso

I'm running into this issue. I'm finding that docker tasks will execute successfully (albeit, no progress output in the console), but images, containers don't show in the extension UI.

However, if I update the Docker Path as above, the UI still not working, but I actually break the docker tasks now! This is an example of the error I get in the tasks console:

/snap/docker/current/bin/docker: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by /snap/docker/current/bin/docker) /snap/docker/current/bin/docker: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by /snap/docker/current/bin/docker) Process exited with code 1

cathalmchale avatar Oct 10 '23 13:10 cathalmchale

Could it just be permissions? I've added my user to the docker security group. Is that the user that the extension UI assumes? The reason I ask is that, when I change the Docker Path setting, the UI has message like "Docker not found, are you sure it's installed", but if I get rid of that setting (so that tasks work - back to using command "docker" rather than "/snap/docker/current/bin/docker") then the UI simply says "No items found" for images and "Tutorial: Get started with Docker" for containers.

Actually, as I say this, it's probably not permissions, but rather that the console output is being suppressed, as observed in the (successful) Docker Task console.

cathalmchale avatar Oct 10 '23 13:10 cathalmchale

I saw this on 6.2.0-34-generic #34~22.04.1-Ubuntu with snap installation latest/stable: d037ac07 2023-11-01 and Docker extension v1.27.0. In the terminal in code it gave /snap/bin/docker as output of which docker command. Setting the Docker Path variable to this value did not help. But surprisingly, setting it to /snap/docker/current/bin/docker worked. Looks to me like the link is not followed: /snap/bin/docker -> /usr/bin/snap

SchuhMichael avatar Nov 04 '23 23:11 SchuhMichael

The binary at /snap/bin/docker is a snap wrapper for the Docker binary which has additional sandboxing that fails when run from another snap wrapped app (the standard vscode install on Ubuntu is often a snap app). The Docker binary at /snap/docker/current/bin/docker is the raw Docker binary. I haven’t had a chance to check out the current state of the underlying issues, but last I checked, the errors are at the low level snap sandbox implementation and seem to be unrelated to Docker or VSCode specifically.

danegsta avatar Nov 05 '23 01:11 danegsta

/snap/docker/current/bin/docker

You saved me one hell of a nightmare. Thank you very much. Your solution works for me.

Regards, #0K

aalavandhaann avatar Jan 11 '24 15:01 aalavandhaann

/snap/docker/current/bin/docker

Worked for me too, perfectly!

pedroachagas avatar Mar 14 '24 12:03 pedroachagas