Skip to main content

Module quadlet

Module quadlet 

Source
Expand description

Quadlet export: translate a parsed compose file into Podman systemd units. Translate a parsed compose file into Podman Quadlet unit files.

Quadlet is Podman’s systemd integration: declarative .container, .network and .volume units placed under ~/.config/containers/systemd/ that a systemd generator turns into services, so systemd owns the lifecycle (boot, restart, dependencies) instead of a long-running podup process.

This is an additive export path, not a replacement for the runner. It maps the common compose fields and warns — loudly, never silently — for every field that is set but has no Quadlet equivalent yet, so generated units never quietly drop configuration.

Structs§

QuadletOutput
The result of a generation run: the units plus any warnings about set but unmapped fields.
QuadletUnit
A single generated unit file: its name and full contents.

Functions§

generate
Translate a compose file into Quadlet units for the given project name, resolving relative build contexts against the current directory (the common case: running from the project directory). Use generate_at to resolve them against an explicit base directory instead.
generate_at
As generate, but resolves a service’s relative build: context against base_dir (the compose file’s directory) rather than the current directory. The systemd generator runs a .build unit with no cwd, so a unit written for it must carry an absolute SetWorkingDirectory; pass the compose base here.
write_units
Write units into dir, creating it if needed, and return the paths written in order. Defense in depth: refuse any unit whose file name is not a plain path component. The library already sanitizes stems, but a write target must never contain a separator, . or .. that could escape dir. Shared by generate quadlet -o and autostart --mode quadlet, so both place units through the identical safety check.