Browse Source

run-docker.sh: allow to set custom image via environment variable

android-5
Leonid Plyushch 6 years ago
parent
commit
4f0cc87981
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 6
      scripts/run-docker.sh

6
scripts/run-docker.sh

@ -10,12 +10,12 @@ else
REPOROOT="$(dirname $(readlink -f $0))/../" REPOROOT="$(dirname $(readlink -f $0))/../"
fi fi
IMAGE_NAME=termux/package-builder : ${TERMUX_BUILDER_IMAGE_NAME:=termux/package-builder}
: ${CONTAINER_NAME:=termux-package-builder} : ${CONTAINER_NAME:=termux-package-builder}
USER=builder USER=builder
echo "Running container '$CONTAINER_NAME' from image '$IMAGE_NAME'..." echo "Running container '$CONTAINER_NAME' from image '$TERMUX_BUILDER_IMAGE_NAME'..."
docker start $CONTAINER_NAME > /dev/null 2> /dev/null || { docker start $CONTAINER_NAME > /dev/null 2> /dev/null || {
echo "Creating new container..." echo "Creating new container..."
@ -24,7 +24,7 @@ docker start $CONTAINER_NAME > /dev/null 2> /dev/null || {
--name $CONTAINER_NAME \ --name $CONTAINER_NAME \
--volume $REPOROOT:$HOME/termux-packages \ --volume $REPOROOT:$HOME/termux-packages \
--tty \ --tty \
$IMAGE_NAME $TERMUX_BUILDER_IMAGE_NAME
if [ "$UNAME" != Darwin ]; then if [ "$UNAME" != Darwin ]; then
if [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ] if [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ]
then then

Loading…
Cancel
Save