aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2019-02-15 15:46:42 +0100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-15 06:46:42 -0800
commitcd369b710796505fb0dbcfafed546597eee3786d (patch)
tree8c9879e049a6b63b0f40f784753f2d2fbec313c0
parentcc146e32dcc32c0213c501d734c8c9d61c974ee5 (diff)
downloadqmk_firmware-cd369b710796505fb0dbcfafed546597eee3786d.tar.gz
qmk_firmware-cd369b710796505fb0dbcfafed546597eee3786d.zip
docker_build.sh: Run container in interactive mode (#5088)
* docker_build.sh: Run container in interactive mode * Add message about QMK Toolbox * Update Docker docs
-rw-r--r--docs/getting_started_build_tools.md8
-rwxr-xr-xutil/docker_build.sh3
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md
index dbed200d1..eb9f5b370 100644
--- a/docs/getting_started_build_tools.md
+++ b/docs/getting_started_build_tools.md
@@ -129,12 +129,12 @@ If you have trouble and want to ask for help, it is useful to generate a *Win_Ch
129 129
130## Docker 130## Docker
131 131
132If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker CE](https://docs.docker.com/install/#supported-platforms), run the following command from the `qmk_firmware` directory to build a keyboard/keymap: 132If this is a bit complex for you, Docker might be the turnkey solution you need. After installing [Docker CE](https://docs.docker.com/install/#supported-platforms), run the following command from the `qmk_firmware` directory to build a keyboard/keymap:
133```bash 133```bash
134util/docker_build.sh keyboard:keymap 134util/docker_build.sh keyboard:keymap
135# For example: util/docker_build.sh ergodox_ez:steno 135# For example: util/docker_build.sh ergodox_ez:steno
136``` 136```
137This will compile the targeted keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, the `default` keymap is used. Note that the parameter format is the same as when building with `make`. 137This will compile the desired keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, the `default` keymap is used. Note that the parameter format is the same as when building with `make`.
138 138
139You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use: 139You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use:
140```bash 140```bash
@@ -147,7 +147,7 @@ There is also support for building _and_ flashing the keyboard straight from Doc
147util/docker_build.sh keyboard:keymap:target 147util/docker_build.sh keyboard:keymap:target
148# For example: util/docker_build.sh planck/rev6:default:dfu-util 148# For example: util/docker_build.sh planck/rev6:default:dfu-util
149``` 149```
150If you're on Linux, this should work out of the box. On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use QMK Toolbox instead. 150If you're on Linux, this should work out of the box. On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use [QMK Toolbox](https://github.com/qmk/qmk_toolbox) instead.
151 151
152!> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**. 152!> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**.
153 153
diff --git a/util/docker_build.sh b/util/docker_build.sh
index 26075cc90..e7aeac8f3 100755
--- a/util/docker_build.sh
+++ b/util/docker_build.sh
@@ -39,11 +39,12 @@ if [ -n "$target" ]; then
39 else 39 else
40 echo "Error: target requires docker-machine to work on your platform" >&2 40 echo "Error: target requires docker-machine to work on your platform" >&2
41 echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2 41 echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2
42 echo "Consider flashing with QMK Toolbox (https://github.com/qmk/qmk_toolbox) instead" >&2
42 exit 3 43 exit 3
43 fi 44 fi
44fi 45fi
45dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows 46dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows
46 47
47# Run container and build firmware 48# Run container and build firmware
48docker run --rm $usb_args -v "$dir":/qmk_firmware qmkfm/qmk_firmware \ 49docker run --rm -it $usb_args -v "$dir":/qmk_firmware qmkfm/qmk_firmware \
49 make "$keyboard${keymap:+:$keymap}${target:+:$target}" 50 make "$keyboard${keymap:+:$keymap}${target:+:$target}"