lazydocker icon indicating copy to clipboard operation
lazydocker copied to clipboard

Add podman support?

Open james-antill opened this issue 6 years ago • 34 comments

The TUI looks great, but alas. podman seems to be the new new thing now so hopefully it's easy to add support? -- https://github.com/containers/libpod

james-antill avatar Jun 30 '19 04:06 james-antill

I'm not familiar with podman. Is that an alternative to docker for containerization?

jesseduffield avatar Jun 30 '19 05:06 jesseduffield

After heaving read into it a bit more, podman would be slightly tricky to support, because there are loads of places where I'm talking to the docker client directly rather than using CLI commands. It's not too hard to swap over most of them, but e.g. the stats object I get back from the client to generate the graphs is very detailed and I don't believe you can get that same object from the command line

jesseduffield avatar Jun 30 '19 11:06 jesseduffield

The fact that lazydocker talks directly to Docker Engine is great and I think there is a possiblity to easily implement talking to Docker or Podman, by creating an interface that would be implemented by 2 structs representing Docker client and Podman's one. I have to first get familiar with lazydocker's codebase though.

Podman's Go API is documented here: https://github.com/containers/libpod/blob/master/API.md

Dunno more details about that, like which package to import and how to start, but I guess it can be done.

Also, I just learned about this project from HN. @jesseduffield I'm very glad that you started it (just like lazygit) and I think that I'll try to contribute some code and help as much as I can, cause I see a value in this project.

dawidd6 avatar Jun 30 '19 17:06 dawidd6

Good to have you back @dawidd6! If you need any pointers let me know :)

jesseduffield avatar Jun 30 '19 23:06 jesseduffield

Podman is pretty much mature at this point, any chance of this happening?

ghost avatar Feb 04 '20 15:02 ghost

Would you like to help?

dawidd6 avatar Feb 04 '20 15:02 dawidd6

I can test stuff for you, but sadly that's about it. (:

ghost avatar Feb 05 '20 17:02 ghost

podman has a podman-docker abstraction library and podman-compose is a thing.

With lots of luck just installing these and alias docker-compose=podman-compose would work.

Maybe someone more brave than me can try this.

heylix avatar Mar 16 '20 16:03 heylix

It's not as simple as aliasing the docker cli. I think symlinking the socket descriptor will be needed 🤔 https://github.com/containers/libpod/issues/4234

I wonder if lazydocker can be configured

DrSensor avatar Apr 22 '20 22:04 DrSensor

Podman v2.0 now has a RESTful API which I believe is mostly docker compliant, not sure how lazydocker works exactly but it may help. Reference docs: http://docs.podman.io/en/latest/Reference.html

thecatwasnot avatar Sep 27 '20 16:09 thecatwasnot

With podman installed I can run sudo lazydocker and it works fine. How can I get rid of sudo?

What I tried:

  • add user to docker group and reboot https://docs.docker.com/engine/install/linux-postinstall/
  • run sudo chmod 777 /var/run/docker.sock
  • run sudo chmod 777 /run/podman/podman.sock

Other tools from https://awesome-docker.netlify.app/#cli-tools have the exact same problem.

bcm0 avatar Jul 06 '21 11:07 bcm0

FWIW You can enable Podman's socket (which is normally not needed for regular Podman usage) via: systemctl enable --now podman.socket

And then:

# docker run --rm -it -v /run/podman/podman.sock:/var/run/docker.sock lazyteam/lazydocker

maliayas avatar Mar 29 '23 12:03 maliayas

Yeah that works great. I did: export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock ./lazydocker

For this issue, I think a --podman option to set the defaults sensibly would make sense.

eean avatar Apr 06 '23 03:04 eean

you guys are great, thanks a lot!!!

ildar avatar Apr 06 '23 06:04 ildar

Add this to your ~/.bashrc for the ultra lazy among us.

alias lazypodman='DOCKER_HOST=unix:///run/user/1000/podman/podman.sock lazydocker'

yohosuff avatar Jul 12 '23 21:07 yohosuff

FWIW, I can confirm that the DOCKER_HOST approach works with Podman (rootless here), but the logs tab in lazydocker never updates and is even is empty for certain containers. Similar symptoms to #306 and #218.

witten avatar Aug 05 '23 22:08 witten

+1

debilin avatar Jan 23 '24 19:01 debilin

alias lazypodman='DOCKER_HOST=unix:///run/user/1000/podman/podman.sock lazydocker'

I guess this works only with podman installed with a "pretend to be docker" shim. In my case where I do have a proper docker installation and podman as well (GNU/Linux Debian) -- this just leads to

image

And given that podman has some of unique concepts (e.g. pods), podman support should entail adding some custom functionality I guess.

yarikoptic avatar Aug 19 '24 13:08 yarikoptic