2016-05-28 00:24:50 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e -u
|
|
|
|
|
2016-06-04 00:41:30 +02:00
|
|
|
# Read settings from .termuxrc if existing
|
|
|
|
test -f $HOME/.termuxrc && . $HOME/.termuxrc
|
|
|
|
: ${TERMUX_TOPDIR:="$HOME/.termux-build"}
|
2016-05-28 00:24:50 +02:00
|
|
|
|
|
|
|
IMAGE_NAME=termux/package-builder
|
2016-06-04 00:41:30 +02:00
|
|
|
CONTAINER_NAME=termux-package-builder
|
2016-05-28 00:24:50 +02:00
|
|
|
|
2016-06-04 00:41:30 +02:00
|
|
|
echo "Running container '$CONTAINER_NAME' from image '$IMAGE_NAME'..."
|
|
|
|
|
|
|
|
docker start $CONTAINER_NAME > /dev/null 2> /dev/null || {
|
|
|
|
echo "Creating new container..."
|
|
|
|
docker run \
|
|
|
|
-d \
|
|
|
|
--name $CONTAINER_NAME \
|
|
|
|
-v $PWD:/root/termux-packages \
|
|
|
|
-t $IMAGE_NAME
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$#" -eq "0" ]; then
|
|
|
|
docker exec -it $CONTAINER_NAME bash
|
|
|
|
else
|
|
|
|
docker exec -it $CONTAINER_NAME $@
|
|
|
|
fi
|
2016-05-28 00:24:50 +02:00
|
|
|
|
|
|
|
|