# 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 ```sh cargo install podman-openrc ``` # Usage ```sh podman-openrc # 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: ```toml user = "" # Optional property, set if you don't want to run the Podman command with the root user # Required section [service] 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. depend = [""] # Name of any service in /etc/init.d to depend on restart = "unless-stopped" # Restart, optional. Defaults to "unless-stopped" detach = 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 [environment] ASPNETCORE_ENVIRONMENT = "Test" # If you have a not TOML-compatible key name, use "" around the key name # Optionally, you can assign one or more port mappings [[ports]] host = 80 # Port on your computer container = 8080 # Port inside the container protocol = "tcp" # Protocol, optional # Optionally you can also assign volumes [[volumes]] volume = "" # Volume name or path on host path = "" # Volume location/target inside container # Or you can make more advanced volumes with mounts [[mounts]] typ = "bind" # Mount type source = "/etc/hosts" # Source file target = "/etc/hosts" # Target file read_only = true # Whether to use ro mode, optional # Optionally you can use Podman secrets in an array [[secrets]] key = "" # Secret key used in `podman secret` target = "" # Target secret filename in /var/run/secrets. Optional, defaults to the key # Optionally, you can configure a healthcheck [service.healthcheck] cmd = "" # The command or route to run/check interval = "5m" # Interval, optional start_period = "30s" # Start period (start after), optional retries = 3 # Max retries, optional on_failure = "none" # On failure options, optional ```