termux-packages/scripts/update-docker.sh
2019-02-15 18:01:09 +02:00

20 lines
494 B
Bash
Executable File

#!/bin/sh
set -e -u
CONTAINER=termux-package-builder
IMAGE=termux/package-builder
docker pull $IMAGE
LATEST=$(docker inspect --format "{{.Id}}" $IMAGE)
RUNNING=$(docker inspect --format "{{.Image}}" $CONTAINER)
if [ $LATEST = $RUNNING ]; then
echo "Image '$IMAGE' used in the container '$CONTAINER' is already up to date"
else
echo "Image '$IMAGE' used in the container '$CONTAINER' has been updated - removing the outdated container"
docker stop $CONTAINER
docker rm -f $CONTAINER
fi