Podlet generates podman quadlet (systemd-like) files from a podman command.
You can also view the demo on asciinema.
podman run
podman kube play
podman network create
podman volume create
--skip-services-check
Podlet can be acquired in several ways:
podman run quay.io/k9withabone/podlet
cargo binstall podlet
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 compose Generate podman quadlet files from a compose file 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 ```
Use the following commands for more usage information:
- podlet --help
- podlet podman --help
- podlet compose --help
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.
When converting compose files, not all options are supported by podman/quadlet. This is especially true when converting to a pod as some options must be applied to the pod as a whole. If podlet encounters an unsupported option an error will be returned. You will have to remove or comment out unsupported options to proceed.
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.