1
0
mirror of https://github.com/stucki/docker-lineageos synced 2025-01-09 17:39:47 -05:00

privileged is now switchable

This commit is contained in:
Budleigh Salterton driving a Miura 2016-04-04 17:54:27 +02:00
parent 5f65d68abd
commit b9ac69cf57
2 changed files with 22 additions and 2 deletions

22
run.sh
View File

@ -9,6 +9,26 @@ CONTAINER=cyanogenmod
REPOSITORY=stucki/cyanogenmod
TAG=cm-13.0
FORCE_BUILD=0
PRIVILEGED=
while [[ $# > 0 ]]
do
key="$1"
case $key in
-r|--rebuild)
FORCE_BUILD=1
;;
-p|--privileged)
PRIVILEGED="--privileged -v /dev/bus/usb:/dev/bus/usb"
;;
*)
shift # past argument or value
;;
esac
shift
done
# Create shared folders
[[ -e "$SOURCE" ]] || mkdir -p $SOURCE
@ -42,7 +62,7 @@ if [[ $IS_RUNNING == "true" ]]; then
elif [[ $IS_RUNNING == "false" ]]; then
docker start -i $CONTAINER
else
docker run --privileged -v $SOURCE:$CONTAINER_HOME/android -v $CCACHE:/srv/ccache -v /dev/bus/usb:/dev/bus/usb -i -t --name $CONTAINER $REPOSITORY:$TAG
docker run $PRIVILEGED -v $SOURCE:$CONTAINER_HOME/android -v $CCACHE:/srv/ccache -i -t --name $CONTAINER $REPOSITORY:$TAG
fi
exit $?

View File

@ -9,4 +9,4 @@ fi
export USER="cmbuild"
# Launch screen session
screen -s /bin/bash
/bin/bash --login