diff --git a/docs/source/markdown/podman-systemd.unit.5.md b/docs/source/markdown/podman-systemd.unit.5.md index c8b39cf16b..aa0667c31b 100644 --- a/docs/source/markdown/podman-systemd.unit.5.md +++ b/docs/source/markdown/podman-systemd.unit.5.md @@ -240,6 +240,8 @@ Specify a custom network for the container. This has the same format as the `--n to `podman run`. For example, use `host` to use the host network in the container, or `none` to not set up networking in the container. +This key can be listed multiple times. + #### `ExposeHostPort=` Exposes a port, or a range of ports (e.g. `50-59`), from the host to the container. Equivalent diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index ffb1d6f9fe..d3bde16fdc 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -373,9 +373,11 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile podman.addf("--tz=%s", timezone) } - network, ok := container.Lookup(ContainerGroup, KeyNetwork) - if ok && len(network) > 0 { - podman.addf("--network=%s", network) + networks := container.LookupAll(ContainerGroup, KeyNetwork) + for _, network := range networks { + if len(network) > 0 { + podman.addf("--network=%s", network) + } } // Run with a pid1 init to reap zombies by default (as most apps don't do that)