From fb44099b0ff28d53671419fb5422456ac2328a76 Mon Sep 17 00:00:00 2001 From: Mahmood Alansari <17938956+maanoobh@users.noreply.github.com> Date: Sat, 4 Feb 2023 07:57:15 +0000 Subject: [PATCH 1/2] specify which service to pull and update --- dockcheck.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 dockcheck.sh diff --git a/dockcheck.sh b/dockcheck.sh old mode 100644 new mode 100755 index 346b8a5..7273d2d --- a/dockcheck.sh +++ b/dockcheck.sh @@ -136,8 +136,8 @@ if [ -n "$GotUpdates" ] ; then for i in "${SelectedUpdates[@]}" do ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files"}}') - $DockerBin -f "$ContPath" pull - $DockerBin -f "$ContPath" up -d + $DockerBin -f "$ContPath" pull "$i" + $DockerBin -f "$ContPath" up -d "$i" done else printf "\nNo updates installed, exiting.\n" From 8f37417eab39dfd938b31fcbc80c461a896fd3f6 Mon Sep 17 00:00:00 2001 From: Mahmood Alansari <17938956+maanoobh@users.noreply.github.com> Date: Sat, 4 Feb 2023 08:42:05 +0000 Subject: [PATCH 2/2] Fixed a bug, the command expects the service name in the file. --- dockcheck.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dockcheck.sh b/dockcheck.sh index 7273d2d..0e79463 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -135,9 +135,10 @@ if [ -n "$GotUpdates" ] ; then if [ "$UpdYes" != "${UpdYes#[Yy]}" ] ; then for i in "${SelectedUpdates[@]}" do - ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files"}}') - $DockerBin -f "$ContPath" pull "$i" - $DockerBin -f "$ContPath" up -d "$i" + ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files" }}') + ContName=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.service" }}') + $DockerBin -f "$ContPath" pull "$ContName" + $DockerBin -f "$ContPath" up -d "$ContName" done else printf "\nNo updates installed, exiting.\n"