From eeb719296d80787253fff5b79db8eadf80114502 Mon Sep 17 00:00:00 2001 From: mag37 Date: Mon, 24 Nov 2025 22:07:25 +0100 Subject: [PATCH] cleaned up the config info queries --- dockcheck.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dockcheck.sh b/dockcheck.sh index c801c35..eb93118 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -554,13 +554,9 @@ if [[ -n "${GotUpdates:-}" ]]; then for i in "${SelectedUpdates[@]}"; do ((CurrentQue+=1)) printf "\n%bNow updating (%s/%s): %b%s%b\n" "$c_teal" "$CurrentQue" "$NumberofUpdates" "$c_blue" "$i" "$c_reset" -# ContLabels=$(docker inspect "$i" --format '{{json .Config.Labels}}') -# ContImage=$(docker inspect "$i" --format='{{.Config.Image}}') -# ContPath=$($jqbin -r '."com.docker.compose.project.working_dir"' <<< "$ContLabels") ContConfig=$(docker inspect "$i" --format '{{json .}}') - ContImage=$($jqbin -r '."Config"."Image"' <<< "$ContConfig") # OLD? Remove if replaced with ContFull + ContImage=$($jqbin -r '."Config"."Image"' <<< "$ContConfig") ImageId=$($jqbin -r '."Image"' <<< "$ContConfig") -# ContFull=$(docker image inspect "$ImageId" --format "{{index .RepoTags 0}}") ContPath=$($jqbin -r '."Config"."Labels"."com.docker.compose.project.working_dir"' <<< "$ContConfig") [[ "$ContPath" == "null" ]] && ContPath="" @@ -598,8 +594,8 @@ if [[ -n "${GotUpdates:-}" ]]; then ((CurrentQue+=1)) unset CompleteConfs # Extract labels and metadata - ContLabels=$(docker inspect "$i" --format '{{json .Config.Labels}}') - ContImage=$(docker inspect "$i" --format='{{.Config.Image}}') + ContConfig=$(docker inspect "$i" --format '{{json .}}') + ContLabels=$($jqbin -r '."Config"."Labels"' <<< "$ContConfig") ContPath=$($jqbin -r '."com.docker.compose.project.working_dir"' <<< "$ContLabels") [[ "$ContPath" == "null" ]] && ContPath="" ContConfigFile=$($jqbin -r '."com.docker.compose.project.config_files"' <<< "$ContLabels")