mirror of
https://github.com/rancher/os.git
synced 2025-08-31 14:23:11 +00:00
detect /dev/kvm or optionally force --privileged
using PRIVILEGED=1 in ./scripts/docker-run.sh
This commit is contained in:
@@ -8,6 +8,9 @@ if [ -n "$BIND_DIR" ]; then
|
||||
fi
|
||||
DOCKER_ARGS="-t -v $BIND_DIR:/go/src/github.com/rancherio/os"
|
||||
fi
|
||||
if [ -c /dev/kvm ] || [ "${PRIVILEGED}" == "1" ]; then
|
||||
DOCKER_ARGS="${DOCKER_ARGS} --privileged"
|
||||
fi
|
||||
|
||||
docker rm -fv ros-build >/dev/null 2>&1 || true
|
||||
exec docker run --privileged -i -v /var/run/docker.sock:/var/run/docker.sock $DOCKER_ARGS --name=ros-build ros-build "$@"
|
||||
exec docker run -i -v /var/run/docker.sock:/var/run/docker.sock $DOCKER_ARGS --name=ros-build ros-build "$@"
|
||||
|
Reference in New Issue
Block a user