Implement x-podman.pod_args to override --pod-args default

Allow setting an argument list as x-podman.pod_args to override the
default value `--infra=false --share=`. `--pod-args` passed on the command
line takes precedence over the value set in docker-compose.yml; the values
are not merged.

Fixes #1057.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
This commit is contained in:
Matthias Schiffer
2025-02-07 00:42:14 +01:00
parent aa47a373ca
commit 43a2f1d01f
10 changed files with 229 additions and 4 deletions

View File

@ -174,3 +174,17 @@ services:
x-podman:
in_pod: false
```
It is also possible to override the default arguments for pod creation that are
used when --pod-args is not passed on the command line:
```yml
version: "3"
services:
cont:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "httpd", "-f", "-p", "8080"]
x-podman:
pod_args: ["--infra=false", "--share=", "--cpus=1"]
```
When not set in docker-compose.yml or on the command line, the pod args default
to `["--infra=false", "--share="]`.