run-docker.sh: don't modify $HOME variable which is set outside
This commit is contained in:
parent
98a9ec70b9
commit
380e6fd501
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e -u
|
set -e -u
|
||||||
|
|
||||||
HOME=/home/builder
|
CONTAINER_HOME_DIR=/home/builder
|
||||||
UNAME=$(uname)
|
UNAME=$(uname)
|
||||||
if [ "$UNAME" = Darwin ]; then
|
if [ "$UNAME" = Darwin ]; then
|
||||||
# Workaround for mac readlink not supporting -f.
|
# Workaround for mac readlink not supporting -f.
|
||||||
@ -29,13 +29,13 @@ docker start $CONTAINER_NAME >/dev/null 2>&1 || {
|
|||||||
docker run \
|
docker run \
|
||||||
--detach \
|
--detach \
|
||||||
--name $CONTAINER_NAME \
|
--name $CONTAINER_NAME \
|
||||||
--volume $REPOROOT:$HOME/termux-packages \
|
--volume $REPOROOT:$CONTAINER_HOME_DIR/termux-packages \
|
||||||
--tty \
|
--tty \
|
||||||
$TERMUX_BUILDER_IMAGE_NAME
|
$TERMUX_BUILDER_IMAGE_NAME
|
||||||
if [ "$UNAME" != Darwin ]; then
|
if [ "$UNAME" != Darwin ]; then
|
||||||
if [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ]; then
|
||||||
echo "Changed builder uid/gid... (this may take a while)"
|
echo "Changed builder uid/gid... (this may take a while)"
|
||||||
docker exec $DOCKER_TTY $CONTAINER_NAME sudo chown -R $(id -u) $HOME
|
docker exec $DOCKER_TTY $CONTAINER_NAME sudo chown -R $(id -u) $CONTAINER_HOME_DIR
|
||||||
docker exec $DOCKER_TTY $CONTAINER_NAME sudo chown -R $(id -u) /data
|
docker exec $DOCKER_TTY $CONTAINER_NAME sudo chown -R $(id -u) /data
|
||||||
docker exec $DOCKER_TTY $CONTAINER_NAME sudo usermod -u $(id -u) builder
|
docker exec $DOCKER_TTY $CONTAINER_NAME sudo usermod -u $(id -u) builder
|
||||||
docker exec $DOCKER_TTY $CONTAINER_NAME sudo groupmod -g $(id -g) builder
|
docker exec $DOCKER_TTY $CONTAINER_NAME sudo groupmod -g $(id -g) builder
|
||||||
|
Loading…
Reference in New Issue
Block a user