get the latest image tag

This commit is contained in:
Daniel Hansson 2018-12-09 13:32:57 +01:00 committed by GitHub
parent 4b26f29cda
commit 9f03fc84ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,22 @@ debug_mode
readonly DB_FILE="$DOCKERBACKUP/images.db"
readonly IMG_DIR="$DOCKERBACKUP/images"
# Update docker images
# This updates ALL Docker images:
if [ "$(docker ps -a >/dev/null 2>&1 && echo yes || echo no)" == "yes" ]
then
docker images --format "{{.Repository}}:{{.Tag}}" | grep :latest | xargs -L1 docker pull
fi
if [ -f $SCRIPTS/dockerprune.sh ]
then
bash $SCRIPTS/dockerprune.sh
else
docker container prune -f
docker image prune -a -f
docker volume prune -f
fi
save_images() {
echo "Create ${IMG_DIR}"
if [[ ! -d "${IMG_DIR}" ]]; then