containers / podlet

Generate Podman Quadlet files from a Podman command, compose file, or existing object
https://crates.io/crates/podlet
Mozilla Public License 2.0
322 stars 10 forks source link

FEAT: generate from running container #23

Closed johnmmcgee closed 6 months ago

johnmmcgee commented 8 months ago

It would be nice if it were possible to generate a systemd file from an already running container.

johnmmcgee commented 8 months ago

To add to this, possibly have it format podman generate systemd into quadlet format.

k9withabone commented 8 months ago

Generating a quadlet file from a running container has been an idea in the back of my mind for a while. However, it's a low priority.

have it format podman generate systemd into quadlet format

Unfortunately, podman generate systemd is being deprecated in favor of quadlet (see the podman 4.7.0 release notes). Other options for implementing this that I can think of are running the podman container inspect command or using the podman REST API.

johnmmcgee commented 8 months ago

@k9withabone I actually found this to work pretty well, but it would be nice if we could get this built in, in some way:

podlet -i podman $(podman container inspect jellyfin | jq -r '.[0].Config.CreateCommand[2:] | join(" ")')

k9withabone commented 6 months ago

Sorry I linked the wrong issue in that commit. Please ignore it.