-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
Description
When I run docker compose up --build, i see this error:
[+] Running 0/0
â ‹ Container viva-extensionsbackend-1 Creating 0.0s
â ‹ Container viva-mockbackend-1 Creating 0.0s
â ‹ Container cool_chatelet Recreate 0.0s
strconv.Atoi: parsing "": invalid syntax
Steps To Reproduce
I have no idea how i got into this state, but I know what the problem is!
I have a container with these labels:
"Labels": {
"com.docker.compose.project": "viva",
"com.docker.compose.service": "electron",
"com.docker.compose.version": "2.12.2"
}
The container does NOT have the label com.docker.compose.container-number
The convergence engine blows up trying to figure out how to deal with this.
Here's the first place it blows up:
compose/pkg/compose/convergence.go
Line 376 in 32ae036
| n, err := strconv.Atoi(c.Labels[api.ContainerNumberLabel]) |
If I change that line to ignore the error, here's the second place it blows up:
compose/pkg/compose/convergence.go
Line 430 in 32ae036
| number, err := strconv.Atoi(replaced.Labels[api.ContainerNumberLabel]) |
The fix that worked for me locally was to change change getContainers here:
compose/pkg/compose/containers.go
Line 44 in 32ae036
| containers, err := s.apiClient().ContainerList(ctx, moby.ContainerListOptions{ |
to filter out containers that are missing this label.
Compose Version
available on request
Docker Environment
available on request
Anything else?
No response

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
