Podlet generates podman quadlet (systemd-like) files from a podman command.
podman run
podman kube play
podman network create
podman volume create
Podlet can be acquired in several ways:
Download a prebuilt binary from releases
Use cargo-binstall to get a prebuilt binary: cargo binstall podlet
Build and install with cargo install podlet
``` $ podlet -h
Podlet generates podman quadlet (systemd-like) files from a podman command.
Usage: podlet [OPTIONS]
Commands: podman Generate a podman quadlet file from a podman command help Print this message or the help of the given subcommand(s)
Options:
-f, --file [
To generate a quadlet file, just put podlet
in front of your podman command!
``` $ podlet podman run quay.io/podman/hello
[Container] Image=quay.io/podman/hello ```
This is useful for more complicated commands you are copying. For example, let's create a quadlet file for running caddy. We'll also use a few options for additional sections in the file.
``` $ podlet --file . --install --description Caddy \ podman run \ --restart always \ -p 8000:80 \ -p 8443:443 \ -v ./Caddyfile:/etc/caddy/Caddyfile \ -v caddy_data:/data \ docker.io/library/caddy:latest
Wrote to file: ./caddy.container
$ cat caddy.container
[Unit] Description=Caddy
[Container] Image=docker.io/library/caddy:latest PublishPort=8000:80 PublishPort=8443:443 Volume=./Caddyfile:/etc/caddy/Caddyfile Volume=caddy_data:/data
[Service] Restart=always
[Install] WantedBy=default.target ```
The name for the file was automatically pulled from the image name, but can be overridden with the --name
option.
Podlet also supports creating kube, network, and volume quadlet files. However, not all options for their corresponding podman commands are supported by quadlet. Accordingly, those options are also not supported by podlet.
``` $ podlet podman kube play --network pasta --userns auto kube.yaml
[Kube] Yaml=kube.yaml Network=pasta UserNS=auto ```
Podlet is not (yet) a validator for podman commands. Some podman options are incompatible with each other and most options require specific formatting and/or only accept certain values. However, a few options are fully parsed and validated in order to facilitate creating the quadlet file.
For the kube play
, network create
, and volume create
commands, not all of podman's options are available as not all options are supported by quadlet.
Podlet is meant to be used with podman v4.5.0 or newer. Some quadlet options are unavailable or behave differently with earlier versions of podman/quadlet.
This is my (@k9withabone) first real rust project and is mostly meant as a learning project for myself. That said, contributions, suggestions, and/or comments are appreciated! Feel free to create an issue, discussion, or pull request.
All source code for podlet is licensed under the Mozilla Public License v2.0. View the LICENSE file for more information.