From 7b42579a02aca442edeac0e9e93957da67ca9d74 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Wed, 7 Feb 2024 15:18:46 -0600 Subject: [PATCH] Add image puller helper separate of apply script. --- scripts/pull_containers.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/pull_containers.sh diff --git a/scripts/pull_containers.sh b/scripts/pull_containers.sh new file mode 100644 index 0000000..9cf7219 --- /dev/null +++ b/scripts/pull_containers.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +mapfile -t AVAILABLE_IMAGES < <(run show container image | awk '{ if ( NR > 1 ) { print $1 ":" $2} }') +mapfile -t CONFIG_IMAGES < <(find /config/config-parts/ -type f -exec sed -nr "s/set container name .* image '(.*)'/\1/p" {} + | sort | uniq) + +for image in "${CONFIG_IMAGES[@]}"; do +if [[ ! " ${AVAILABLE_IMAGES[*]} " =~ \ ${image}\ ]]; then + echo "Pulling image ${image}" + podman pull image "${image}" +fi +done