docker/qmk/Dockerfile

84 lines
1.7 KiB
Docker
Raw Normal View History

2022-11-18 23:29:49 -08:00
## Build qmk-cli
FROM python:3.8-slim-buster AS qmk_cli_builder
WORKDIR /app
COPY qmk_cli .
RUN pip3 install build
RUN python3 -m build
## Base container
FROM debian:11-slim
# Install dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -y \
avrdude \
binutils-arm-none-eabi \
binutils-riscv64-unknown-elf \
build-essential \
ca-certificates \
clang-format-11 \
dfu-programmer \
dfu-util \
dos2unix \
ca-certificates \
gcc \
gcc-arm-none-eabi \
gcc-riscv64-unknown-elf \
git \
libfl2 \
libnewlib-arm-none-eabi \
picolibc-riscv64-unknown-elf \
python3 \
python3-pip \
software-properties-common \
tar \
teensy-loader-cli \
unzip \
tar \
wget \
zip \
&& rm -rf /var/lib/apt/lists/*
# Install python packages
RUN python3 -m pip install --upgrade \
pip \
setuptools \
wheel \
nose2 \
yapf
# upgrade avr-gcc... for reasons?
RUN /bin/bash -c "set -o pipefail && \
wget -q https://github.com/ZakKemble/avr-gcc-build/releases/download/v8.3.0-1/avr-gcc-8.3.0-x64-linux.tar.bz2 -O - | tee /tmp/asdf.tar.bz2 | md5sum -c <(echo '588D0BEA4C5D21A1A06AA17625684417 -') && \
tar xfj /tmp/asdf.tar.bz2 --strip-components=1 -C / && \
rm -rf /share/ /tmp/*"
# Install qmk-cli
COPY --from=qmk_cli_builder /app/dist /tmp/dist
RUN python3 -m pip install /tmp/dist/qmk-*.whl && \
rm -rf /tmp/dist
# Copy qmk repo.
# Make sure you've pulled submodules first!
COPY qmk_firmware /qmk_firmware
RUN chmod -R 777 /qmk_firmware
VOLUME /qmk_firmware/keyboards
VOLUME /build_output
WORKDIR /qmk_firmware
ENV SKIP_GIT true
COPY entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
# How to use:
# docker run -it \
# --user 1000:1001 \
# -v "$(pwd)/kb:/qmk_firmware/keyboards" \
#