mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
quadlet: Support multiple Network=
This is supported by podman run with --network, so makes sense. Signed-off-by: Alexander Larsson <alexl@redhat.com>
This commit is contained in:
@ -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
|
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.
|
not set up networking in the container.
|
||||||
|
|
||||||
|
This key can be listed multiple times.
|
||||||
|
|
||||||
#### `ExposeHostPort=`
|
#### `ExposeHostPort=`
|
||||||
|
|
||||||
Exposes a port, or a range of ports (e.g. `50-59`), from the host to the container. Equivalent
|
Exposes a port, or a range of ports (e.g. `50-59`), from the host to the container. Equivalent
|
||||||
|
@ -373,10 +373,12 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile
|
|||||||
podman.addf("--tz=%s", timezone)
|
podman.addf("--tz=%s", timezone)
|
||||||
}
|
}
|
||||||
|
|
||||||
network, ok := container.Lookup(ContainerGroup, KeyNetwork)
|
networks := container.LookupAll(ContainerGroup, KeyNetwork)
|
||||||
if ok && len(network) > 0 {
|
for _, network := range networks {
|
||||||
|
if len(network) > 0 {
|
||||||
podman.addf("--network=%s", network)
|
podman.addf("--network=%s", network)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Run with a pid1 init to reap zombies by default (as most apps don't do that)
|
// Run with a pid1 init to reap zombies by default (as most apps don't do that)
|
||||||
runInit := container.LookupBoolean(ContainerGroup, KeyRunInit, true)
|
runInit := container.LookupBoolean(ContainerGroup, KeyRunInit, true)
|
||||||
|
Reference in New Issue
Block a user