diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-03 17:59:31 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-03 17:59:31 +0000 |
commit | 7654f42e2d36c49b388abc653c5017170eea3ce1 (patch) | |
tree | bfd4ae634249d9730432670c25df7a0bf7aa4eed /tcwg-cleanup-stale-containers.sh | |
parent | 50781c0bdac875936dab082d1043f7f4a3317546 (diff) |
Docker image pull/use: Fix and improve
Change-Id: Ieb39c841151533d7553786f78f80fbb7a62857e2
Diffstat (limited to 'tcwg-cleanup-stale-containers.sh')
-rwxr-xr-x | tcwg-cleanup-stale-containers.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tcwg-cleanup-stale-containers.sh b/tcwg-cleanup-stale-containers.sh index fe626621..cc89a01e 100755 --- a/tcwg-cleanup-stale-containers.sh +++ b/tcwg-cleanup-stale-containers.sh @@ -184,10 +184,10 @@ if $cleanup_images; then image_stamp="$stamp_dir/$(echo "$image" | tr "/:" "_")" remove_if_not_used_since=$(($(date +%s) - 3*24*60*60)) # Use negative comparison to handle non-existent stamp files. - if ! [ "$(stat -c %Z "$image_stamp.use" 2>/dev/null)" \ - -gt $remove_if_not_used_since ]; then + if ! [ "$(stat -c %Z "$image_stamp.use")" \ + -gt $remove_if_not_used_since ] 2>/dev/null; then # Untag the image. - docker rmi "$image" + docker rmi -f "$image" fi done # Prune untagged images. |