mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-25 17:10:27 +00:00
Update containers_version.sh
This commit is contained in:
parent
57013f5ed8
commit
dfca9d126b
1 changed files with 12 additions and 1 deletions
|
@ -44,7 +44,18 @@ for appinfo in $(docker ps --format '{{.Names}}%{{.Image}}'); do
|
|||
break
|
||||
fi
|
||||
else
|
||||
echo "通过服务名匹配"
|
||||
# 容器和镜像均未匹配成功,通过服务名匹配
|
||||
realapp=echo $containername|awk -F"-" '{print $1}'
|
||||
services=docker compose -p $realapp ps --services
|
||||
for service in $services; do
|
||||
if [[ $service == $appname ]];then
|
||||
echo "$containername容器匹配成功app:$appname"
|
||||
initdata="$initdata $appname"
|
||||
wget -O /tmp/$appname_get_version.sh https://raw.githubusercontent.com/Websoft9/docker-$appname/main/src/get_version.sh
|
||||
bash /tmp/$appname_get_version.sh $containername
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue