octoprint-klipper-docker/Dockerfile

101 lines
3.1 KiB
Docker

FROM ghcr.io/siwatinc/siwat-ubuntubaseimage:focal
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Bangkok
RUN apt-get update && apt-get install -y \
cmake \
g++ \
wget \
unzip \
psmisc \
git \
python3-virtualenv \
virtualenv \
python3-dev \
libffi-dev \
build-essential \
tzdata \
zlib1g-dev \
libjpeg-dev \
ffmpeg \
iputils-ping
EXPOSE 5000
ARG tag=master
WORKDIR /opt/octoprint
#Create an octoprint user
RUN useradd -ms /bin/bash octoprint && adduser octoprint dialout
RUN chown octoprint:octoprint /opt/octoprint
USER octoprint
#This fixes issues with the volume command setting wrong permissions
RUN mkdir /home/octoprint/.octoprint
#Install Octoprint
RUN git clone --branch $tag https://github.com/foosel/OctoPrint.git /opt/octoprint \
&& virtualenv venv \
&& ./venv/bin/pip install .
RUN /opt/octoprint/venv/bin/python -m pip install \
https://github.com/1r0b1n0/OctoPrint-Tempsgraph/archive/master.zip \
https://github.com/tpmullan/OctoPrint-DetailedProgress/archive/master.zip \
https://github.com/AliceGrey/OctoprintKlipperPlugin/archive/master.zip \
https://github.com/jneilliii/OctoPrint-TabOrder/archive/master.zip \
https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/archive/master.zip \
https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip \
https://github.com/birkbjo/OctoPrint-Themeify/archive/master.zip \
https://github.com/jneilliii/OctoPrint-Python3PluginCompatibilityCheck/archive/master.zip \
https://github.com/marian42/octoprint-preheat/archive/master.zip \
https://github.com/OllisGit/OctoPrint-FilamentManager/releases/latest/download/master.zip \
https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip \
https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip \
https://github.com/jneilliii/OctoPrint-PrusaSlicerThumbnails/archive/master.zip \
https://gitlab.com/mosaic-mfg/canvas-plugin/-/archive/master/canvas-plugin-master.zip \
https://github.com/costas-basdekis/MarlinGcodeDocumentation/archive/master.zip \
https://github.com/crealitycloud/OctoPrint-Crealitycloud/archive/master.zip \
https://github.com/crysxd/OctoApp-Plugin/archive/refs/heads/release.zip \
https://github.com/paukstelis/OctoPrint-Cancelobject/archive/master.zip \
https://github.com/OllisGit/OctoPrint-CostEstimation/releases/latest/download/master.zip \
https://github.com/eyal0/OctoPrint-MultipleUpload/archive/master.zip \
https://gitlab.com/mosaic-mfg/canvas-plugin/-/archive/3.0.3/canvas-plugin-3.0.3.zip \
https://github.com/wgcv/RewriteM600/archive/master.zip
VOLUME /home/octoprint/.octoprint
### Klipper setup ###
USER root
RUN apt-get install -y sudo
COPY klippy.sudoers /etc/sudoers.d/klippy
RUN useradd -ms /bin/bash klippy
# This is to allow the install script to run without error
RUN rm -f /bin/systemctl
RUN ln -s /bin/true /bin/systemctl
USER octoprint
WORKDIR /home/octoprint
RUN git clone https://github.com/KevinOConnor/klipper
RUN ./klipper/scripts/install-ubuntu-18.04.sh
USER root
# Clean up hack for install script
RUN rm -f /bin/systemctl
COPY start.py /
COPY runklipper.py /
COPY start.sh /
COPY printer.cfg /
CMD bash /start.sh