mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Prioritize showing the container name over labels
This commit is contained in:
parent
bedde4a037
commit
9e9e005114
1 changed files with 2 additions and 6 deletions
|
|
@ -253,12 +253,8 @@ func (c *DockerCommand) GetContainers(existingContainers []*Container) ([]*Conta
|
||||||
}
|
}
|
||||||
|
|
||||||
newContainer.Container = ctr
|
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 = strings.TrimLeft(ctr.Names[0], "/")
|
||||||
newContainer.Name = name
|
|
||||||
} else {
|
|
||||||
newContainer.Name = strings.TrimLeft(ctr.Names[0], "/")
|
|
||||||
}
|
|
||||||
newContainer.ServiceName = ctr.Labels["com.docker.compose.service"]
|
newContainer.ServiceName = ctr.Labels["com.docker.compose.service"]
|
||||||
newContainer.ProjectName = ctr.Labels["com.docker.compose.project"]
|
newContainer.ProjectName = ctr.Labels["com.docker.compose.project"]
|
||||||
newContainer.ContainerNumber = ctr.Labels["com.docker.compose.container"]
|
newContainer.ContainerNumber = ctr.Labels["com.docker.compose.container"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue