containers / containers/podman-compose

`com.docker.compose.network` should be set

Open
#1,451 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
`docker-compose` sets the `com.docker.compose.network` label on any created networks according to the compose network, whereas `podman-compose` does not.

The main reason this matters is because if you spin up a compose stack using `podman-compose`, this label will be missing. If you then subsequently try to start/restart the stack using `docker-compose`, it will fail with:

> network XXX_default was found but has incorrect label com.docker.compose.network set to "" (expected: "default")

I think this is a reasonable one to fix since [the compose spec](https://github.com/compose-spec/compose-spec/blob/main/06-networks.md#labels) says that:
> Compose sets com.docker.compose.project and com.docker.compose.network labels.

**To Reproduce**

I've created a minimal example here: https://github.com/multimeric/PodmanComposeNetwork.

You basically just have to do this:
```bash
export PODMAN_COMPOSE_PROVIDER=podman-compose
podman compose up -d
# Switch to using docker-compose
export PODMAN_COMPOSE_PROVIDER=docker-compose
podman compose up -d
```

**Expected behavior**
I expect `docker-compose` to not crash.

**Actual behavior**
```
network podmancomposenetwork_default was found but has incorrect label com.docker.compose.network set to "" (expected: "default")
```

**Environment:**
- OS: Mac
- podman version: 5.8.2
- podman compose version: 1.5.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.