docker.el icon indicating copy to clipboard operation
docker.el copied to clipboard

podman does not support "network ls --filter dangling=true"

Open holgerschurig opened this issue 2 years ago • 3 comments

I have the newest and shiniest podman installed, fresh from git:

$ podman version 
Client:       Podman Engine
Version:      4.2.0-dev
API Version:  4.2.0-dev
Go Version:   go1.17.11
Git Commit:   9fac1b335f681400a029e9d8014f45fa5634ec40
Built:        Tue Jun 14 13:53:13 2022
OS/Arch:      linux/amd64

And when I run M-x docker --- after (setq docker-command "podman") of course --- I get this error messages:

error in process sentinel: docker-process-sentinel: Error running: "podman network ls --filter dangling=true --format="[{{ json .ID }},{{ json .ID }},{{ json .Name }},{{ json .Driver }}]"" (exited abnormally with code 125)
error in process sentinel: Error running: "podman network ls --filter dangling=true --format="[{{ json .ID }},{{ json .ID }},{{ json .Name }},{{ json .Driver }}]"" (exited abnormally with code 125)

And really, if I run this command in the shell, I get an error:

schurig@desktop:~$ podman network ls --filter dangling=true --format="[{{ json .ID }},{{ json .ID }},{{ json .Name }},{{ json .Driver }}]"
Error: invalid filter "dangling"

It works however without the filter:

schurig@desktop:~$ podman network ls --format="[{{ json .ID }},{{ json .ID }},{{ json .Name }},{{ json .Driver }}]"
["2f259bab93aa","2f259bab93aa","podman","bridge"]

Now I looked into docker.el source code, and found that this filter is hardcoded into several functions. Can we make this customizable?

This might actually also help docker users of stable distributions. For example, when I look at https://manpages.debian.org/testing/podman-docker/docker-network-ls.1.en.html I don't see a "dangling" filter documented.

holgerschurig avatar Jun 15 '22 07:06 holgerschurig

Well, podman is not supported (see #110).

If you think it's feasible to support it, please help provide a path toward that.

Supporting old dockers is also not a priority to me :sweat_smile:

Silex avatar Jun 15 '22 07:06 Silex

That said, removing dangling=true can be disabled partially by using setting docker-show-status to nil, but then we need some new variable like docker-no-pretty-listings which would use docker-container-entries instead of docker-container-entries-propertized, etc.

Silex avatar Jun 15 '22 07:06 Silex

I learned that only "podman network ls" doesn't support this filter. Interestingly, "podman image ls" and "podman volume ls" support it:

schurig@desktop:~$ podman image ls
REPOSITORY                         TAG         IMAGE ID      CREATED       SIZE
localhost/dev                      latest      fb17046ed4bc  24 hours ago  1.45 GB
localhost/bullseye.bootstrap.i386  latest      f92965da12ed  42 hours ago  326 MB
schurig@desktop:~$ podman image ls --filter dangling=true
REPOSITORY  TAG         IMAGE ID    CREATED     SIZE
schurig@desktop:~$ podman volume ls
schurig@desktop:~$ podman volume ls --filter dangling=true
schurig@desktop:~$ podman network ls
NETWORK ID    NAME        DRIVER
2f259bab93aa  podman      bridge
schurig@desktop:~$ podman network ls --filter dangling=true
Error: invalid filter "dangling"
schurig@desktop:~$ 

I also opened a ticket at Podman, because the problem might actually be there: https://github.com/containers/podman/issues/14595

If Podman fixes this, then only the part of "Stable Linux distributions with old versions of Docker doesn't have this filter" would be true.

holgerschurig avatar Jun 15 '22 08:06 holgerschurig

Looks like it was merged, so this should be resolved.

Silex avatar Oct 10 '22 10:10 Silex