diff --git a/pkg/commands/container.go b/pkg/commands/container.go index d97cbdae..a7926839 100644 --- a/pkg/commands/container.go +++ b/pkg/commands/container.go @@ -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 diff --git a/pkg/commands/docker.go b/pkg/commands/docker.go index c90c4c02..269e9666 100644 --- a/pkg/commands/docker.go +++ b/pkg/commands/docker.go @@ -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"]