20 lines
494 B
Bash
Executable File
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
|
|
|