From 7b83bb9d267fc4f2909cb87965d873487a9a4e1d Mon Sep 17 00:00:00 2001 From: Haim Gelfenbeyn Date: Wed, 15 Jan 2025 14:36:20 -0500 Subject: Allow running Docker container on MacOS (without in-container USB support) (#24412) --- util/docker_cmd.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'util') diff --git a/util/docker_cmd.sh b/util/docker_cmd.sh index 18725db068..cb0c4f3281 100755 --- a/util/docker_cmd.sh +++ b/util/docker_cmd.sh @@ -34,15 +34,17 @@ if [ -z "$RUNTIME" ]; then fi fi - -# IF we are using docker on non Linux and docker-machine isn't working print an error -# ELSE set usb_args -if [ ! "$(uname)" = "Linux" ] && [ "$RUNTIME" = "docker" ] && ! docker-machine active >/dev/null 2>&1; then - errcho "Error: target requires docker-machine to work on your platform" - errcho "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" - exit 3 -else - usb_args="--privileged -v /dev:/dev" +# If SKIP_FLASHING_SUPPORT is defined, do not check for docker-machine and do not run a privileged container +if [ -z "$SKIP_FLASHING_SUPPORT" ]; then + # IF we are using docker on non Linux and docker-machine isn't working print an error + # ELSE set usb_args + if [ ! "$(uname)" = "Linux" ] && [ "$RUNTIME" = "docker" ] && ! docker-machine active >/dev/null 2>&1; then + errcho "Error: target requires docker-machine to work on your platform" + errcho "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" + exit 3 + else + usb_args="--privileged -v /dev:/dev" + fi fi qmk_firmware_dir=$(pwd -W 2>/dev/null) || qmk_firmware_dir=$PWD # Use Windows path if on Windows -- cgit v1.2.3