lazydocker
lazydocker copied to clipboard
Add podman support?
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
I'm not familiar with podman. Is that an alternative to docker for containerization?
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
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.
Good to have you back @dawidd6! If you need any pointers let me know :)
Podman is pretty much mature at this point, any chance of this happening?
Would you like to help?
I can test stuff for you, but sadly that's about it. (:
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.
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
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
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
dockergroup 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.
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
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.
you guys are great, thanks a lot!!!
Add this to your ~/.bashrc for the ultra lazy among us.
alias lazypodman='DOCKER_HOST=unix:///run/user/1000/podman/podman.sock lazydocker'
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.
+1
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
And given that podman has some of unique concepts (e.g. pods), podman support should entail adding some custom functionality I guess.