Quadlet - allow deleting the network when stopping the service

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
Ygal Blum
2025-04-09 14:24:20 -04:00
parent ce7db6e455
commit 0d4a148ee6
5 changed files with 95 additions and 17 deletions

View File

@ -1330,23 +1330,24 @@ particularly interesting when using special options to control network creation,
Valid options for `[Network]` are listed below:
| **[Network] options** | **podman network create equivalent** |
|-------------------------------------|--------------------------------------|
| ContainersConfModule=/etc/nvd\.conf | --module=/etc/nvd\.conf |
| DisableDNS=true | --disable-dns |
| DNS=192.168.55.1 | --dns=192.168.55.1 |
| Driver=bridge | --driver bridge |
| Gateway=192.168.55.3 | --gateway 192.168.55.3 |
| GlobalArgs=--log-level=debug | --log-level=debug |
| Internal=true | --internal |
| IPAMDriver=dhcp | --ipam-driver dhcp |
| IPRange=192.168.55.128/25 | --ip-range 192.168.55.128/25 |
| IPv6=true | --ipv6 |
| Label="XYZ" | --label "XYZ" |
| NetworkName=foo | podman network create foo |
| Options=isolate=true | --opt isolate=true |
| PodmanArgs=--dns=192.168.55.1 | --dns=192.168.55.1 |
| Subnet=192.5.0.0/16 | --subnet 192.5.0.0/16 |
| **[Network] options** | **podman network create equivalent** |
|-------------------------------------|-----------------------------------------------------------------|
| ContainersConfModule=/etc/nvd\.conf | --module=/etc/nvd\.conf |
| DisableDNS=true | --disable-dns |
| DNS=192.168.55.1 | --dns=192.168.55.1 |
| Driver=bridge | --driver bridge |
| Gateway=192.168.55.3 | --gateway 192.168.55.3 |
| GlobalArgs=--log-level=debug | --log-level=debug |
| Internal=true | --internal |
| IPAMDriver=dhcp | --ipam-driver dhcp |
| IPRange=192.168.55.128/25 | --ip-range 192.168.55.128/25 |
| IPv6=true | --ipv6 |
| Label="XYZ" | --label "XYZ" |
| NetworkDeleteOnStop=true | Add ExecStopPost to delete the network when the unit is stopped |
| NetworkName=foo | podman network create foo |
| Options=isolate=true | --opt isolate=true |
| PodmanArgs=--dns=192.168.55.1 | --dns=192.168.55.1 |
| Subnet=192.5.0.0/16 | --subnet 192.5.0.0/16 |
Supported keys in `[Network]` section are:
@ -1429,6 +1430,10 @@ Set one or more OCI labels on the network. The format is a list of
This key can be listed multiple times.
### `NetworkDeleteOnStop=` (defaults to `false`)
When set to `true` the network is deleted when the service is stopped
### `NetworkName=`
The (optional) name of the Podman network. If this is not specified, the default value of