From 3444a2b5c3e5361805b9ebb82d8c348fc1b5233e Mon Sep 17 00:00:00 2001 From: Matthew Titmus Date: Mon, 19 Feb 2024 12:32:56 -0500 Subject: [PATCH] Bump Alpine version to 3.19; minor fixes --- Dockerfile | 4 ++-- build/executed-by-cron.sh | 6 ++---- build/generate-crontab.sh | 32 +++++++++++--------------------- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index fcb51dc..5ad0bde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM alpine:3.13 +FROM alpine:3.19 LABEL maintainer="Matt Titmus " -LABEL date="2021-05-19" +LABEL date="2024-02-19" ARG DOCKER_VERSION=1.11.1 diff --git a/build/executed-by-cron.sh b/build/executed-by-cron.sh index 3f3b1cb..1dbb5e9 100644 --- a/build/executed-by-cron.sh +++ b/build/executed-by-cron.sh @@ -4,10 +4,8 @@ echo "[$(date)] Docker GC starting." >> /var/log/cron.log 2>&1 /usr/bin/docker-gc >> /var/log/cron.log 2>&1 -if [ "$CLEAN_UP_VOLUMES" -eq "1" ] -then - if [ $(docker volume ls -qf dangling=true | wc -l) -gt 0 ] - then +if [ "$CLEAN_UP_VOLUMES" == "1" ]; then + if [ "$(docker volume ls -qf dangling=true | wc -l)" -gt 0 ]; then echo "Cleaning up dangling volumes." >> /var/log/cron.log 2>&1 docker volume rm $(docker volume ls -qf dangling=true) >> /var/log/cron.log 2>&1 else diff --git a/build/generate-crontab.sh b/build/generate-crontab.sh index 580a619..6f3d107 100755 --- a/build/generate-crontab.sh +++ b/build/generate-crontab.sh @@ -1,9 +1,8 @@ #!/bin/bash -DEFAULT_CRON="0 9 * * *" +DEFAULT_CRON="0 0 * * *" -if [ "$CRON" ] -then +if [ "$CRON" ]; then echo "Using user-defined CRON variable: $CRON" else echo "CRON variable undefined. Using default of \"$DEFAULT_CRON\"" @@ -12,48 +11,39 @@ fi GC_ARGS="" -if [ "$CLEAN_UP_VOLUMES" ] -then +if [ "$CLEAN_UP_VOLUMES" ]; then GC_ARGS="$GC_ARGS CLEAN_UP_VOLUMES=$CLEAN_UP_VOLUMES" fi -if [ "$DRY_RUN" ] -then +if [ "$DRY_RUN" ]; then GC_ARGS="$GC_ARGS DRY_RUN=$DRY_RUN" fi -if [ "$EXCLUDE_VOLUMES_IDS_FILE" ] -then +if [ "$EXCLUDE_VOLUMES_IDS_FILE" ]; then GC_ARGS="$GC_ARGS EXCLUDE_VOLUMES_IDS_FILE=$EXCLUDE_VOLUMES_IDS_FILE" fi -if [ "$FORCE_CONTAINER_REMOVAL" ] -then +if [ "$FORCE_CONTAINER_REMOVAL" ]; then GC_ARGS="$GC_ARGS FORCE_CONTAINER_REMOVAL=$FORCE_CONTAINER_REMOVAL" fi -if [ "$FORCE_IMAGE_REMOVAL" ] -then +if [ "$FORCE_IMAGE_REMOVAL" ]; then GC_ARGS="$GC_ARGS FORCE_IMAGE_REMOVAL=$FORCE_IMAGE_REMOVAL" fi -if [ "$GRACE_PERIOD_SECONDS" ] -then +if [ "$GRACE_PERIOD_SECONDS" ]; then GC_ARGS="$GC_ARGS GRACE_PERIOD_SECONDS=$GRACE_PERIOD_SECONDS" fi -if [ "$MINIMUM_IMAGES_TO_SAVE" ] -then +if [ "$MINIMUM_IMAGES_TO_SAVE" ]; then GC_ARGS="$GC_ARGS MINIMUM_IMAGES_TO_SAVE=$MINIMUM_IMAGES_TO_SAVE" fi -if [ "$REMOVE_VOLUMES" ] -then +if [ "$REMOVE_VOLUMES" ]; then GC_ARGS="$GC_ARGS REMOVE_VOLUMES=$REMOVE_VOLUMES" fi -if [ "$VOLUME_DELETE_ONLY_DRIVER" ] -then +if [ "$VOLUME_DELETE_ONLY_DRIVER" ]; then GC_ARGS="$GC_ARGS VOLUME_DELETE_ONLY_DRIVER=$VOLUME_DELETE_ONLY_DRIVER" fi