1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

feat: handles container exits better and uses the real time when container has exited (#3504)

This commit is contained in:
Amir Raminfar
2025-01-03 13:09:36 -08:00
committed by GitHub
parent cc620ad429
commit 46fb09e2f7
16 changed files with 191 additions and 90 deletions

View File

@@ -385,12 +385,16 @@ func newContainerFromJSON(c types.ContainerJSON, host string) Container {
Tty: c.Config.Tty,
}
if createdAt, err := time.Parse(time.RFC3339Nano, c.Created); err == nil {
container.Created = createdAt.UTC()
}
if startedAt, err := time.Parse(time.RFC3339Nano, c.State.StartedAt); err == nil {
container.StartedAt = startedAt.UTC()
}
if createdAt, err := time.Parse(time.RFC3339Nano, c.Created); err == nil {
container.Created = createdAt.UTC()
if stoppedAt, err := time.Parse(time.RFC3339Nano, c.State.FinishedAt); err == nil {
container.FinishedAt = stoppedAt.UTC()
}
if c.State.Health != nil {