From 2086e35e6657ae29b77e0839f0251fbb79f03f5c Mon Sep 17 00:00:00 2001 From: tgasslander Date: Sun, 4 Jan 2026 16:29:12 +0100 Subject: [PATCH 1/2] add build instructions --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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" From 21cacf3be837fb8856fd3c62c7f50ddb9bcef721 Mon Sep 17 00:00:00 2001 From: tgasslander Date: Sun, 4 Jan 2026 16:29:32 +0100 Subject: [PATCH 2/2] move ARG ZEPHYR_SDK_INSTALL_DIR assignment ARGs don't survive between stages. Moved it to where it's being used. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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} +