|
@ -20,28 +20,27 @@ echo "Running container '$CONTAINER_NAME' from image '$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..." |
|
|
docker run \ |
|
|
docker run \ |
|
|
--detach \ |
|
|
--detach \ |
|
|
--env HOME=$HOME \ |
|
|
--name $CONTAINER_NAME \ |
|
|
--name $CONTAINER_NAME \ |
|
|
--volume $REPOROOT:$HOME/termux-packages \ |
|
|
--volume $REPOROOT:$HOME/termux-packages \ |
|
|
--tty \ |
|
|
--tty \ |
|
|
$IMAGE_NAME |
|
|
$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 |
|
|
echo "Changed builder uid/gid... (this may take a while)" |
|
|
echo "Changed builder uid/gid... (this may take a while)" |
|
|
docker exec --tty $CONTAINER_NAME chown -R $(id -u) $HOME |
|
|
docker exec --tty $CONTAINER_NAME chown -R $(id -u) $HOME |
|
|
docker exec --tty $CONTAINER_NAME chown -R $(id -u) /data |
|
|
docker exec --tty $CONTAINER_NAME chown -R $(id -u) /data |
|
|
docker exec --tty $CONTAINER_NAME usermod -u $(id -u) builder |
|
|
docker exec --tty $CONTAINER_NAME usermod -u $(id -u) builder |
|
|
docker exec --tty $CONTAINER_NAME groupmod -g $(id -g) builder |
|
|
docker exec --tty $CONTAINER_NAME groupmod -g $(id -g) builder |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if [ "$#" -eq "0" ]; then |
|
|
if [ "$#" -eq "0" ]; then |
|
|
docker exec --interactive --tty --user $USER $CONTAINER_NAME bash |
|
|
docker exec --interactive --tty $CONTAINER_NAME bash |
|
|
else |
|
|
else |
|
|
docker exec --interactive --tty --user $USER $CONTAINER_NAME $@ |
|
|
docker exec --interactive --tty $CONTAINER_NAME $@ |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|