podman-openrc-0.1.1 is not a library.
Podman OpenRC generator
This is a simple application written in Rust to convert a simple Podman service definition in TOML format to an OpenRC service script.
Installation
Usage
# For example: podman-openrc input.toml output.service.sh
TOML service description format
The TOML format describing a Podman service is non-standard. It is NOT a Podlet. The format is like this:
= "<USERNAME>" # Optional property, set if you don't want to run the Podman command with the root user
# Required section
[]
= "<CONTAINER NAME>" # Container name, required
= "<IMAGE>" # Podman image name
= "<NETWORK>" # Optional, if you want to run the container within a specific network. Set to "host" if you don't want to use the podman networking.
= ["<SERVICE NAME>"] # Name of any service in /etc/init.d to depend on
= "unless-stopped" # Restart, optional. Defaults to "unless-stopped"
= true # Run container in detach mode, optional, default true. Recommended.
= "<HOSTNAME>" # Host name, optional.
= "<COMMAND>" # Container command to run, optional.
# Optionally set one or more environment variables
[]
= "Test"
# If you have a not TOML-compatible key name, use "" around the key name
# Optionally, you can assign one or more port mappings
[[]]
= 80 # Port on your computer
= 8080 # Port inside the container
= "tcp" # Protocol, optional
# Optionally you can also assign volumes
[[]]
= "<VOLUME NAME>" # Volume name or path on host
= "<PATH>" # Volume location/target inside container
# Or you can make more advanced volumes with mounts
[[]]
= "bind" # Mount type
= "/etc/hosts" # Source file
= "/etc/hosts" # Target file
= true # Whether to use ro mode, optional
# Optionally you can use Podman secrets in an array
[[]]
= "<SECRET KEY>" # Secret key used in `podman secret`
= "<TARGET SECRET FILE>" # Target secret filename in /var/run/secrets. Optional, defaults to the key
# Between environment and secrets: get secret from Podman and set it as environment variable
[[]]
= "<ENV VARIABLE>" # Target environment variable name
= "<SECRET NAME>" # Secret key in `podman secret`
# Optionally, you can configure a healthcheck
[]
= "<HEALTHCHECK COMMAND>" # The command or route to run/check
= "5m" # Interval, optional
= "30s" # Start period (start after), optional
= 3 # Max retries, optional
= "none" # On failure options, optional