This commit is contained in:
Freitas 2025-11-17 08:57:39 +01:00 committed by GitHub
commit f3f3b25db2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -252,12 +252,8 @@ func (c *DockerCommand) GetContainers(existingContainers []*Container) ([]*Conta
}
newContainer.Container = ctr
// if the container is made with a name label we will use that
if name, ok := ctr.Labels["name"]; ok {
newContainer.Name = name
} else {
newContainer.Name = strings.TrimLeft(ctr.Names[0], "/")
}
newContainer.Name = strings.TrimLeft(ctr.Names[0], "/")
newContainer.ServiceName = ctr.Labels["com.docker.compose.service"]
newContainer.ProjectName = ctr.Labels["com.docker.compose.project"]
newContainer.ContainerNumber = ctr.Labels["com.docker.compose.container"]