mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
support custom container names
This commit is contained in:
parent
a27b429807
commit
3bcef6d88c
2 changed files with 7 additions and 2 deletions
|
|
@ -285,7 +285,7 @@ func (c *Container) GetDisplayCPUPerc() string {
|
|||
|
||||
// ProducingLogs tells us whether we should bother checking a container's logs
|
||||
func (c *Container) ProducingLogs() bool {
|
||||
return c.Container.State == "running"
|
||||
return c.Container.State == "running" && !(c.Details.HostConfig.LogConfig.Type == "none")
|
||||
}
|
||||
|
||||
// GetColor Container color
|
||||
|
|
|
|||
|
|
@ -262,7 +262,12 @@ func (c *DockerCommand) GetContainers() ([]*Container, error) {
|
|||
}
|
||||
|
||||
newContainer.Container = container
|
||||
newContainer.Name = strings.TrimLeft(container.Names[0], "/")
|
||||
// if the container is made with a name label we will use that
|
||||
if name, ok := container.Labels["name"]; ok {
|
||||
newContainer.Name = name
|
||||
} else {
|
||||
newContainer.Name = strings.TrimLeft(container.Names[0], "/")
|
||||
}
|
||||
newContainer.ServiceName = container.Labels["com.docker.compose.service"]
|
||||
newContainer.ServiceID = container.Labels["com.docker.compose.config-hash"]
|
||||
newContainer.ProjectName = container.Labels["com.docker.compose.project"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue