compose
compose copied to clipboard
[BUG] Dry run: container names in start(ing) progress entries missing first letter
Description
When starting a service in dry-run mode, the progress events reporting starting the container are missing its first letter:
DRY-RUN MODE - Network compose_default Creating
DRY-RUN MODE - Network compose_default Created
DRY-RUN MODE - Container compose-foobar-2 Creating
DRY-RUN MODE - Container compose-foobar-1 Creating
DRY-RUN MODE - Container compose-foobar-2 Created
DRY-RUN MODE - Container compose-foobar-1 Created
DRY-RUN MODE - Container ompose-foobar-2 Starting
DRY-RUN MODE - Container ompose-foobar-2 Started
DRY-RUN MODE - Container ompose-foobar-1 Starting
DRY-RUN MODE - Container ompose-foobar-1 Started
This comes from https://github.com/docker/compose/blob/main/pkg/api/dryrunclient.go#L107 putting containerName into Names, and not "/" + containerName, since getCanonicalContainerName strips the first letter off (https://github.com/docker/compose/blob/main/pkg/compose/compose.go#L135).
Steps To Reproduce
Run docker compose --progress plain up --dry-run --detach (after docker compose down in case something was up) and observe output.
Compose Version
2.24.2
Docker Environment
No response
Anything else?
No response