Merge pull request #32072 from coolljt0725/fix_log_dead

Fix docker logs a dead container
Upstream-commit: 9518a71ceff0f1aa9abada5b51cbac40f8e8c80e
Component: engine
This commit is contained in:
Brian Goff
2017-04-03 10:42:32 -04:00
committed by GitHub
+4
View File
@@ -29,6 +29,10 @@ func (daemon *Daemon) ContainerLogs(ctx context.Context, containerName string, c
return err
}
if container.RemovalInProgress || container.Dead {
return errors.New("can not get logs from container which is dead or marked for removal")
}
if container.HostConfig.LogConfig.Type == "none" {
return logger.ErrReadLogsNotSupported
}