Merge pull request #32072 from coolljt0725/fix_log_dead

Fix docker logs a dead container
This commit is contained in:
Brian Goff 2017-04-03 10:42:32 -04:00 committed by GitHub
commit 9518a71cef

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
}