Merge pull request #32072 from coolljt0725/fix_log_dead
Fix docker logs a dead container
This commit is contained in:
commit
9518a71cef
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue