diff --git a/Dockerfile b/Dockerfile index e2523cd9..567468ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,7 +90,6 @@ FROM common AS build ARG ARCHITECTURE ARG ZEPHYR_SDK_VERSION -ARG ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk-${ZEPHYR_SDK_VERSION} RUN \ export minimal_sdk_file_name="zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-$(uname -m)_minimal" \ && if [ "${ARCHITECTURE}" = "arm" ]; then arch_format="eabi"; else arch_format="elf"; fi \ @@ -116,5 +115,7 @@ RUN \ #------------------------------------------------------------------------------ FROM dev-generic AS dev +ARG ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk-${ZEPHYR_SDK_VERSION} COPY --from=build ${ZEPHYR_SDK_INSTALL_DIR} ${ZEPHYR_SDK_INSTALL_DIR} + diff --git a/README.md b/README.md index 91196451..1c14532f 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,11 @@ Lightweight Docker images for [ZMK][zmk]. ### Platforms #### Tested + - `arm` #### Not Tested + - `arc` - `arm64` - `mips` @@ -23,6 +25,24 @@ Lightweight Docker images for [ZMK][zmk]. ### Images +#### Build arguments + +The building of the image requires the following build arguments: + +- `ZEPHYR_VERSION`: version of [Zephyr][zephyr] to install (e.g. `4.1.0`) +- `ARCHITECTURE`: target architecture (e.g. `arm`, `x86_64`, etc.) +- `ZEPHYR_SDK_VERSION`: version of [Zephyr SDK][Zephyr SDK] to install (e.g. `0.17.4`) + +Example: + +```shell +docker build \ + --build-arg ZEPHYR_VERSION=4.1.0 \ + --build-arg ARCHITECTURE=x86_64 \ + --build-arg ZEPHYR_SDK_VERSION=0.17.4 \ + -t zmkfirmware/zmk-docker . +``` + #### build For _building_ [ZMK][zmk] firmware with CI. @@ -47,3 +67,4 @@ For _developing_ [ZMK][zmk] (firmware and documentation). [ubuntu]: https://hub.docker.com/_/ubuntu "Ubuntu" [zephyr]: https://github.com/zephyrproject-rtos/zephyr "Zephyr" [zmk]: https://github.com/zmkfirmware/zmk "ZMK" +[zephyr sdk]: https://github.com/zephyrproject-rtos/sdk-ng/tags "Zephyr SDK"