diff options
| -rw-r--r-- | docs/getting_started_docker.md | 7 | ||||
| -rwxr-xr-x | util/docker_cmd.sh | 20 |
2 files changed, 18 insertions, 9 deletions
diff --git a/docs/getting_started_docker.md b/docs/getting_started_docker.md index 2d90d8566a..42322397b4 100644 --- a/docs/getting_started_docker.md +++ b/docs/getting_started_docker.md | |||
| @@ -50,6 +50,13 @@ By default docker or podman are automatically detected and docker is preferred o | |||
| 50 | RUNTIME="podman" util/docker_build.sh keyboard:keymap:target | 50 | RUNTIME="podman" util/docker_build.sh keyboard:keymap:target |
| 51 | ``` | 51 | ``` |
| 52 | 52 | ||
| 53 | If flashing is not required, it's possible to run the container as unprivileged (on Linux), and without docker-machine (on Windows/macOS): | ||
| 54 | |||
| 55 | ``` | ||
| 56 | SKIP_FLASHING_SUPPORT=1 util/docker_build.sh keyboard:keymap:target | ||
| 57 | ``` | ||
| 58 | |||
| 59 | |||
| 53 | ## FAQ | 60 | ## FAQ |
| 54 | 61 | ||
| 55 | ### Why can't I flash on Windows/macOS | 62 | ### Why can't I flash on Windows/macOS |
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 | |||
| 34 | fi | 34 | fi |
| 35 | fi | 35 | fi |
| 36 | 36 | ||
| 37 | 37 | # If SKIP_FLASHING_SUPPORT is defined, do not check for docker-machine and do not run a privileged container | |
| 38 | # IF we are using docker on non Linux and docker-machine isn't working print an error | 38 | if [ -z "$SKIP_FLASHING_SUPPORT" ]; then |
| 39 | # ELSE set usb_args | 39 | # IF we are using docker on non Linux and docker-machine isn't working print an error |
| 40 | if [ ! "$(uname)" = "Linux" ] && [ "$RUNTIME" = "docker" ] && ! docker-machine active >/dev/null 2>&1; then | 40 | # ELSE set usb_args |
| 41 | errcho "Error: target requires docker-machine to work on your platform" | 41 | if [ ! "$(uname)" = "Linux" ] && [ "$RUNTIME" = "docker" ] && ! docker-machine active >/dev/null 2>&1; then |
| 42 | errcho "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" | 42 | errcho "Error: target requires docker-machine to work on your platform" |
| 43 | exit 3 | 43 | errcho "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" |
| 44 | else | 44 | exit 3 |
| 45 | usb_args="--privileged -v /dev:/dev" | 45 | else |
| 46 | usb_args="--privileged -v /dev:/dev" | ||
| 47 | fi | ||
| 46 | fi | 48 | fi |
| 47 | 49 | ||
| 48 | qmk_firmware_dir=$(pwd -W 2>/dev/null) || qmk_firmware_dir=$PWD # Use Windows path if on Windows | 50 | qmk_firmware_dir=$(pwd -W 2>/dev/null) || qmk_firmware_dir=$PWD # Use Windows path if on Windows |
