octoprint-klipper-docker/Dockerfile

98 lines
3.1 KiB
Docker
Raw Normal View History

2022-04-07 14:02:23 +00:00
FROM ghcr.io/siwatinc/siwat-ubuntubaseimage:focal
2018-06-03 22:27:11 +00:00
2020-06-05 15:43:37 +00:00
ARG DEBIAN_FRONTEND=noninteractive
2022-04-07 14:02:23 +00:00
ENV TZ=Asia/Bangkok
2020-06-05 15:43:37 +00:00
RUN apt-get update && apt-get install -y \
2020-02-04 02:28:09 +00:00
cmake \
g++ \
wget \
unzip \
psmisc \
git \
2022-04-07 14:04:56 +00:00
python3-virtualenv \
virtualenv \
2022-04-07 14:04:56 +00:00
python3-dev \
libffi-dev \
build-essential \
2020-06-05 16:22:34 +00:00
tzdata \
2020-06-05 18:14:02 +00:00
zlib1g-dev \
libjpeg-dev
2018-06-03 22:27:11 +00:00
2022-04-07 15:47:54 +00:00
RUN curl --output /usr/share/keyrings/nginx-keyring.gpg https://unit.nginx.org/keys/nginx-keyring.gpg && \
2022-04-07 15:49:52 +00:00
echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ focal unit" > /etc/apt/sources.list.d/unit.list && \
echo "deb-src [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ focal unit" >> /etc/apt/sources.list.d/unit.list
2022-04-07 15:47:54 +00:00
RUN apt-get -y update && apt-get -y install unit
2018-06-03 22:27:11 +00:00
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 \
2020-05-08 18:13:12 +00:00
&& ./venv/bin/pip install .
2018-06-03 22:27:11 +00:00
RUN /opt/octoprint/venv/bin/python -m pip install \
2020-05-29 20:05:50 +00:00
https://github.com/AlexVerrico/Octoprint-Display-ETA/archive/master.zip \
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 \
2020-02-04 02:28:48 +00:00
https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/archive/master.zip \
2020-02-04 13:58:22 +00:00
https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip \
2020-04-02 15:20:42 +00:00
https://github.com/birkbjo/OctoPrint-Themeify/archive/master.zip \
https://github.com/jneilliii/OctoPrint-Python3PluginCompatibilityCheck/archive/master.zip \
https://github.com/OllisGit/OctoPrint-PrintJobHistory/releases/latest/download/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 \
2020-12-05 22:00:31 +00:00
https://github.com/jneilliii/OctoPrint-ConsolidateTempControl/archive/master.zip \
2022-04-07 14:02:23 +00:00
https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective/archive/master.zip
2018-06-03 22:27:11 +00:00
VOLUME /home/octoprint/.octoprint
### Klipper setup ###
USER root
2020-05-29 20:04:17 +00:00
RUN apt-get install -y sudo
2018-06-03 22:27:11 +00:00
COPY klippy.sudoers /etc/sudoers.d/klippy
RUN useradd -ms /bin/bash klippy
# This is to allow the install script to run without error
2022-04-07 14:15:37 +00:00
RUN rm -f /bin/systemctl
RUN ln -s /bin/true /bin/systemctl
2018-06-03 22:27:11 +00:00
USER octoprint
WORKDIR /home/octoprint
RUN git clone https://github.com/KevinOConnor/klipper
RUN ./klipper/scripts/install-ubuntu-18.04.sh
2018-06-03 22:27:11 +00:00
USER root
# Clean up hack for install script
RUN rm -f /bin/systemctl
2018-06-03 22:27:11 +00:00
COPY start.py /
COPY runklipper.py /
COPY start.sh /
COPY printer.cfg /
2022-04-07 15:54:17 +00:00
COPY unitconfig.json /
CMD bash /start.sh