Files
qmk_cli-mirror/Dockerfile
T
Nick Brassel f393ad0053 Use bootstrapper for build environment installation. (#210)
* Use bootstrapper for build environment installation.

* Publishing tags.

* Path.

* Minimisation of final image.

* Minimisation of final image.

* QMK distribution $PATH manipulation, to match qmk_firmware.

* QMK distribution $PATH manipulation, to match qmk_firmware.

* Fixup library search path on macOS.

* Escape hatch for path prefix.

* Add new environment variables.
2025-11-26 07:28:03 +11:00

29 lines
1.0 KiB
Docker

FROM ghcr.io/qmk/qmk_base_container:latest as builder
# Copy package in
ADD dist /tmp/dist
# Install QMK CLI via bootstrap script
ARG TARGETPLATFORM
RUN /bin/bash -c "curl -fsSL https://install.qmk.fm | sh -s -- --confirm"
# Do the equivalent of entering the virtual environment
ENV PATH=/home/qmk/.local/share/uv/tools/qmk/bin:/home/qmk/.local/bin:$PATH \
VIRTUAL_ENV=/home/qmk/.local/share/uv/tools/qmk
# Install python packages
RUN python3 -m pip uninstall -y qmk || true
RUN python3 -m pip install --upgrade pip setuptools wheel nose2 && \
python3 -m pip install /tmp/dist/qmk-*.whl
# 2nd stage so we don't have /tmp/dist in the final image
FROM ghcr.io/qmk/qmk_base_container:latest
# Do the equivalent of entering the virtual environment
ENV PATH=/home/qmk/.local/share/uv/tools/qmk/bin:/home/qmk/.local/bin:$PATH \
VIRTUAL_ENV=/home/qmk/.local/share/uv/tools/qmk
ARG TARGETPLATFORM
COPY --from=builder /home/qmk /home/qmk
COPY --from=builder /usr/lib/udev/rules.d/50-qmk.rules /usr/lib/udev/rules.d/50-qmk.rules