Add a basic Klipper and OctoPrint Dockerfile
This commit is contained in:
parent
c84da24975
commit
81ba26b808
3 changed files with 103 additions and 0 deletions
61
Dockerfile.KlipperOctoprint
Normal file
61
Dockerfile.KlipperOctoprint
Normal file
|
@ -0,0 +1,61 @@
|
|||
FROM python:2.7
|
||||
EXPOSE 8080
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y sudo
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
ENV CURA_VERSION=15.04.6
|
||||
ARG tag=master
|
||||
|
||||
WORKDIR /opt/octoprint
|
||||
|
||||
#install ffmpeg
|
||||
RUN cd /tmp \
|
||||
&& wget -O ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-32bit-static.tar.xz \
|
||||
&& mkdir -p /opt/ffmpeg \
|
||||
&& tar xvf ffmpeg.tar.xz -C /opt/ffmpeg --strip-components=1 \
|
||||
&& rm -Rf /tmp/*
|
||||
|
||||
#install Cura
|
||||
RUN cd /tmp \
|
||||
&& wget https://github.com/Ultimaker/CuraEngine/archive/${CURA_VERSION}.tar.gz \
|
||||
&& tar -zxf ${CURA_VERSION}.tar.gz \
|
||||
&& cd CuraEngine-${CURA_VERSION} \
|
||||
&& mkdir build \
|
||||
&& make \
|
||||
&& mv -f ./build /opt/cura/ \
|
||||
&& rm -Rf /tmp/*
|
||||
|
||||
#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/python setup.py install \
|
||||
&& echo 2
|
||||
|
||||
VOLUME /home/octoprint/.octoprint
|
||||
|
||||
|
||||
### Klipper setup ###
|
||||
|
||||
USER root
|
||||
COPY klippy.sudoers /etc/sudoers.d/klippy
|
||||
RUN useradd -ms /bin/bash klippy
|
||||
|
||||
USER octoprint
|
||||
WORKDIR /home/octoprint
|
||||
RUN git clone https://github.com/KevinOConnor/klipper \
|
||||
&& ./klipper/scripts/install-octopi.sh
|
||||
|
||||
COPY klippyoctostart.py /
|
||||
|
||||
CMD ["/klippyoctostart.py"]
|
Loading…
Add table
Add a link
Reference in a new issue