Add a way to remove dashes in default network names

This is the behavior exhibited by docker compose. The network names are
user-visible through external networks, so previously anyone who
migrated from docker-compose needed to change their configuration. Now
it is possible to select compatibility via a flag in x-podman global
dictionary.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
Povilas Kanapickas
2024-07-06 18:32:10 +03:00
parent 67c5352c3a
commit 5bf4c0fdbe
4 changed files with 66 additions and 15 deletions

View File

@ -91,6 +91,23 @@ The options to the network modes are passed to the `--network` option of the `po
as-is.
## Compatibility of default network names between docker-compose and podman-compose
Current versions of podman-compose may produce different default external network names than
docker-compose under certain conditions. Specifically, docker-compose removes dashes (`-` character)
from project name.
To enable compatibility between docker-compose and podman-compose, specify
`default_net_name_compat: true` under global `x-podman` key:
```
x-podman:
default_net_name_compat: true
```
By default `default_net_name_compat` is `false`. This will change to `true` at some point and the
setting will be removed.
## Custom pods management
Podman-compose can have containers in pods. This can be controlled by extension key x-podman in_pod.