Files
klipper-web-control-docker/klipper/builder.Dockerfile
Dieter Schmidt 4cb2a4b248 update docker build
- BREAKING CHANGE: make printer.cfg the main config file, instead of klipper.cfg.
  existing configs need to be migrated:
  - copy all include statements from klipper.cfg to printer.cfg
  - remove klipper.cfg
- add run_in_venv script to activate venv correctly, then start klipper/moonraker
- add rpi_mcu config file and include in printer.cfg
- add cap_add: SYS_NICE to docker-compose to run klipper_mcu
- build & run klipper with python3
- precompile klipper C-Code in build stage, remove gcc from run image (https://www.klipper3d.org/Packaging.html)
- remove python3 debian packages, globally install with pip instead
2022-09-23 00:38:50 +02:00

52 lines
1.4 KiB
Docker

FROM python:3.10-bullseye
ARG DEBIAN_FRONTEND=noninteractive
ARG KLIPPER_BRANCH="master"
ARG USER=klippy
ARG HOME=/home/${USER}
ARG KLIPPER_VENV_DIR=${HOME}/klippy-env
ENV PKGLIST="libffi-dev build-essential"
ENV PKGLIST="${PKGLIST} libncurses-dev"
ENV PKGLIST="${PKGLIST} libusb-dev"
ENV PKGLIST="${PKGLIST} avrdude gcc-avr binutils-avr avr-libc"
ENV PKGLIST="${PKGLIST} stm32flash libnewlib-arm-none-eabi"
ENV PKGLIST="${PKGLIST} gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0 pkg-config"
RUN useradd -d ${HOME} -ms /bin/bash ${USER}
RUN apt-get update && \
apt-get install -y \
locales \
git \
sudo \
wget \
curl \
gzip \
tar \
${PKGLIST}
RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen
RUN locale-gen
RUN python -m pip install pip -U
ENV LC_ALL en_GB.UTF-8
ENV LANG en_GB.UTF-8
ENV LANGUAGE en_GB:en
USER ${USER}
WORKDIR ${HOME}
### Klipper setup ###
RUN git clone --single-branch --branch ${KLIPPER_BRANCH} https://github.com/Klipper3d/klipper.git klipper
RUN [ ! -d ${KLIPPER_VENV_DIR} ] && python3 -m venv ${KLIPPER_VENV_DIR}
RUN ${KLIPPER_VENV_DIR}/bin/pip install wheel
WORKDIR ${HOME}/klipper
RUN ${KLIPPER_VENV_DIR}/bin/pip install -r scripts/klippy-requirements.txt
RUN ${KLIPPER_VENV_DIR}/bin/python klippy/chelper/__init__.py
RUN ${KLIPPER_VENV_DIR}/bin/python -m compileall klippy
WORKDIR ${HOME}/klipper
CMD ["bash"]