Browse Source

scripts/run-docker.sh: use sudo for privileged operations (when changing uid/gid)

android-5
Leonid Plyushch 6 years ago
parent
commit
530f4ee737
  1. 8
      scripts/run-docker.sh

8
scripts/run-docker.sh

@ -29,10 +29,10 @@ docker start $CONTAINER_NAME > /dev/null 2> /dev/null || {
if [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ]
then
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) /data
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 sudo chown -R $(id -u) $HOME
docker exec --tty $CONTAINER_NAME sudo chown -R $(id -u) /data
docker exec --tty $CONTAINER_NAME sudo usermod -u $(id -u) builder
docker exec --tty $CONTAINER_NAME sudo groupmod -g $(id -g) builder
fi
fi
}

Loading…
Cancel
Save