mirror of https://github.com/samply/bridgehead.git
Consider stopped docker containers for reports, updates
This commit is contained in:
parent
0f44934419
commit
f7c4bf6ac5
|
@ -29,7 +29,7 @@ function hc_send(){
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$UPTIME" ]; then
|
if [ -z "$UPTIME" ]; then
|
||||||
UPTIME=$(docker ps --format 'table {{.Names}} \t{{.RunningFor}} \t {{.Status}} \t {{.Image}}' --filter name=bridgehead || echo "Unable to get docker statistics")
|
UPTIME=$(docker ps -a --format 'table {{.Names}} \t{{.RunningFor}} \t {{.Status}} \t {{.Image}}' --filter name=bridgehead || echo "Unable to get docker statistics")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
|
|
|
@ -60,7 +60,7 @@ done
|
||||||
# Check docker updates
|
# Check docker updates
|
||||||
log "INFO" "Checking for updates to running docker images ..."
|
log "INFO" "Checking for updates to running docker images ..."
|
||||||
docker_updated="false"
|
docker_updated="false"
|
||||||
for IMAGE in $(docker ps --filter "name=bridgehead" --format {{.Image}}); do
|
for IMAGE in $(cat $PROJECT/docker-compose.yml | grep "image:" | sed -e 's_^.*image: \(.*\).*$_\1_g; s_\"__g'); do
|
||||||
log "INFO" "Checking for Updates of Image: $IMAGE"
|
log "INFO" "Checking for Updates of Image: $IMAGE"
|
||||||
if docker pull $IMAGE | grep "Downloaded newer image"; then
|
if docker pull $IMAGE | grep "Downloaded newer image"; then
|
||||||
log "INFO" "$IMAGE updated."
|
log "INFO" "$IMAGE updated."
|
||||||
|
|
Loading…
Reference in New Issue