2016-05-28 00:24:50 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e -u
|
|
|
|
|
|
|
|
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 \
|
2017-01-22 23:13:48 +01:00
|
|
|
-v $PWD:/home/builder/termux-packages \
|
2016-06-04 00:41:30 +02:00
|
|
|
-t $IMAGE_NAME
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$#" -eq "0" ]; then
|
2017-01-22 23:13:48 +01:00
|
|
|
docker exec -i -t -u builder $CONTAINER_NAME bash
|
2016-06-04 00:41:30 +02:00
|
|
|
else
|
2017-01-22 23:13:48 +01:00
|
|
|
docker exec -i -t -u builder $CONTAINER_NAME $@
|
2016-06-04 00:41:30 +02:00
|
|
|
fi
|
2016-05-28 00:24:50 +02:00
|
|
|
|
|
|
|
|