mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-14 23:38:15 +01:00
label-fix to fallback to default :latest when unset
This commit is contained in:
parent
c3c7206622
commit
e191971933
1 changed files with 2 additions and 2 deletions
|
|
@ -560,7 +560,7 @@ if [[ -n "${GotUpdates:-}" ]]; then
|
|||
ContConfig=$(docker inspect "$i" --format '{{json .}}')
|
||||
ContImage=$($jqbin -r '."Config"."Image"' <<< "$ContConfig") # OLD? Remove if replaced with ContFull
|
||||
ImageId=$($jqbin -r '."Image"' <<< "$ContConfig")
|
||||
ContFull=$(docker image inspect "$ImageId" --format "{{index .RepoTags 0}}")
|
||||
# ContFull=$(docker image inspect "$ImageId" --format "{{index .RepoTags 0}}")
|
||||
ContPath=$($jqbin -r '."Config"."Labels"."com.docker.compose.project.working_dir"' <<< "$ContConfig")
|
||||
[[ "$ContPath" == "null" ]] && ContPath=""
|
||||
|
||||
|
|
@ -568,7 +568,7 @@ if [[ -n "${GotUpdates:-}" ]]; then
|
|||
if [[ -n "${DaysKept:-}" ]]; then
|
||||
ContRepo=${ContImage%:*}
|
||||
ContApp=${ContRepo#*/}
|
||||
ContTag=${ContImage#*:}
|
||||
[[ "$ContImage" =~ ":" ]] && ContTag=${ContImage#*:} || ContTag="latest"
|
||||
BackupName="dockcheck/${ContApp}:${RunTimestamp}_${ContTag}"
|
||||
docker tag "$ImageId" "$BackupName"
|
||||
printf "%b%s backed up as %s%b\n" "$c_teal" "$i" "$BackupName" "$c_reset"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue