-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Podman support #226
Comments
Thanks @joachimBurket for submitting this feature request! I'd support this if it doesn't substantially increase the complexity of the code. |
Seems legit. I've tested the
Do you think it could be manageable? I'm not an experienced rust programmer but I'll try to have a look and test out some things :) |
Thanks for the investigation! I would be willing to review a pull request for this, but I have to put some disclaimers on it:
Another avenue that might be worth pursuing: if Podman is aiming for compatibility with Docker, could they just close the gap and match what Docker does (e.g., by changing what |
Thanks for the details about that. I like the other avenue and will ask on Podman repo if they are willing to match Docker's API, which would indeed be a safer bet. |
The api compatibility is at the socket level. So you can run docker in a container and share the socket with the container and everything seems to work correctly.
Theoretically you could also install the docker cli on a podman host instead of the podman-docker method. Either way this should be a workaround for anyone that wants podman support. I confirmed the outputs are different.
|
Hi @kjoyce77, are you saying Docuum now works with Podman (with the Unix domain socket mapping)? This is kind of surprising to me given the differences that @joachimBurket pointed out. Maybe those incompatibilities have been addressed upstream in Podman, and that's why it works now? |
Hi @stepchowfun I don't think anything has changed. Look at the output. If you run a native docker executable against the podman socket it works. If you run a docker wrapper around the podman executable the output is different. |
Ah I think I understand you. The Podman CLI returns different output than the Docker CLI, but not because the daemon is returning different results—only because the CLIs are different. The Docker socket and the Podman socket are interchangeable. Thanks for pointing this out! |
Thanks for the tip @kjoyce77. |
Hi @kjoyce77, I tried to run docuum inside a container with the podman socket mounted to podman run \
--init \
-it \
--rm \
--name docuum \
--volume /var/run/podman/podman.sock:/var/run/docker.sock --volume /root/docuum:/root \
--privileged \
stephanmisc/docuum:0.22.4 --threshold "20 GB"
[2023-08-03 08:43:57 +00:00 INFO] Performing an initial vacuum on startup…
[2023-08-03 08:43:57 +00:00 DEBUG] Docker images are using 0 B, which is within the limit of 20.00 GB.
[2023-08-03 08:43:57 +00:00 INFO] Listening for Docker events…
[2023-08-03 08:46:36 +00:00 DEBUG] Waking up…
[2023-08-03 08:46:36 +00:00 DEBUG] Updating last-used timestamp for image sha256:18c252f1033fc34a27ea8825c2a9946a899eed31589e1f6a0be8d72453ecdb83…
[2023-08-03 08:46:45 +00:00 DEBUG] Docker images are using 0 B, which is within the limit of 20.00 GB.
[2023-08-03 08:46:45 +00:00 DEBUG] Going back to sleep… podman system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 5 1 850.8MB 784.4MB (92%)
Containers 1 1 0B 0B (0%)
Local Volumes 0 0 0B 0B (0%)
podman exec docuum docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 5 2 0B 0B
Containers 1 1 0B 0B
Local Volumes 0 0 0B 0B
Build Cache 0 0 0B 0B Do you have the same behavior? Podman version used: 4.4.1 |
@joachimBurket I didn't get as far as you yet but looking at my post above I ran the same commands with json and indeed got the same result. This is a work thing that got sidelined temporarily. It might be worth seeing what podman-remote reports. I don't see how podman-remote wouldn't also report 0b so there is either some podman configuration needed or a bug that needs fixing on the podman side. |
@joachimBurket This is back from the sideline from me. I think I am just going to read the state.yml file (.local/share/docuum/state.yml) and then do the deletions through a different script. Although I will see if I can find/open an issue with podman. |
For the record, I just tried this with podman version 5.2.5 and docuum 0.25.0 by mounting the podman socket into the container: podman run --init --rm --tty --name docuum --mount type=bind,src=/run/user/1101/podman/podman.sock,dst=/var/run/docker.sock --mount type=volume,source=docuum,target=/root docker.io/stephanmisc/docuum --threshold '3 GB' with output like this:
Assuming that you only need API compatibility, I guess I'll forward this issue to podman? |
Description
Also supporting Podman
Alternatives considered
Can only have Podman on the concerned host.
Additional context
Tried to use it with
podman-docker
(which creates adocker
script that runs podman, and also links/var/run/docker.sock
to/run/podman/podman.sock
.The problem is that the output of the commands (e.g.
docker system ps --format "{{json .}}"
ordocker events --format "{{json .}}"
) are not exactly the same. Maybe by having structs to also parse Podman outputs, Docuum could also work for Podman.The text was updated successfully, but these errors were encountered: