Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add podman support? #4

Open
james-antill opened this issue Jun 30, 2019 · 25 comments
Open

Add podman support? #4

james-antill opened this issue Jun 30, 2019 · 25 comments

Comments

@james-antill
Copy link

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

@jesseduffield
Copy link
Owner

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

@jesseduffield
Copy link
Owner

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

@dawidd6
Copy link
Collaborator

dawidd6 commented Jun 30, 2019

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.

@jesseduffield
Copy link
Owner

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

@ghost
Copy link

ghost commented Feb 4, 2020

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

@dawidd6
Copy link
Collaborator

dawidd6 commented Feb 4, 2020

Would you like to help?

@ghost
Copy link

ghost commented Feb 5, 2020

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

@heylix
Copy link

heylix commented Mar 16, 2020

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.

@DrSensor
Copy link

DrSensor commented Apr 22, 2020

It's not as simple as aliasing the docker cli.
I think symlinking the socket descriptor will be needed 🤔
containers/podman#4234

I wonder if lazydocker can be configured

@thecatwasnot
Copy link

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

@bcm0
Copy link

bcm0 commented Jul 6, 2021

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

What I tried:

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

@maliayas
Copy link

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

@eean
Copy link

eean commented Apr 6, 2023

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.

@ildar
Copy link

ildar commented Apr 6, 2023 via email

@yohosuff
Copy link

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

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

@witten
Copy link

witten commented Aug 5, 2023

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.

@debilin
Copy link

debilin commented Jan 23, 2024

+1

@yarikoptic
Copy link

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.

@loxoron218
Copy link

Any news or progress on this? I would love to use lazydocker with podman!

@arunkv
Copy link

arunkv commented Jan 16, 2025

On MacOS, here's how to set the DOCKER_HOST environment variable for Podman: https://podman-desktop.io/docs/migrating-from-docker/using-the-docker_host-environment-variable You can add this line to to your .bashrc or equivalent:

export DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}')

After setting DOCKER_HOST, lazydocker works with Podman. 👍🏾

@agluck91
Copy link

agluck91 commented Jan 27, 2025

Is this still being worked on? I can help write the code for native podman support. Is there a specific branch the code worked on is on, or am I starting fresh? Setting the docker host is a great idea but I use both docker and podman so I would be adding full support and the ability to switch between the two.

@sachinsenal0x64
Copy link

sachinsenal0x64 commented Jan 28, 2025

Got it to work! Here are the steps I followed. I'm on Arch Linux and using the Fish shell.

First enable

  1. systemctl --user enable --now podman.socket

Then add this to your ~/.config/fish/config.fish

  1. export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock

  2. alias docker='podman'


That's it. Now, just run lazydocker

Image

@Squelch
Copy link

Squelch commented Feb 1, 2025

Got it to work! Here are the steps I followed. I'm on Arch Linux and using the Fish shell.

I'm happy to report that this also works on Ubuntu-esque distros, and presumably Debian too.

As above:

First enable

  1. systemctl --user enable --now podman.socket

Then add this to your ~/.config/bash.rc

  1. export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock

  2. alias docker='podman'

That's it. Now, just run lazydocker

Linux Mint
Image

@codewest
Copy link

codewest commented Feb 2, 2025

Works on Fedora 41 as well.

@tWido
Copy link

tWido commented Feb 19, 2025

Confirming Debian 12. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests