Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docker-gc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ container_log "Container not running" containers.exited
cat containers.exited | while read line
do
EXITED=$(${DOCKER} inspect -f "{{json .State.FinishedAt}}" ${line})
ELAPSED=$(elapsed_time $EXITED)
CREATED=$(${DOCKER} inspect -f "{{json .Created}}" ${line})
ELAPSED_EXITED=$(elapsed_time $EXITED)
ELAPSED_CREATED=$(elapsed_time $CREATED)
ELAPSED=$( (( $ELAPSED_EXITED <= $ELAPSED_CREATED )) && echo "$ELAPSED_EXITED" || echo "$ELAPSED_CREATED" )
if [[ $ELAPSED -gt $GRACE_PERIOD_SECONDS ]]; then
echo $line >> containers.reap.tmp
fi
Expand Down