66 lines
1.7 KiB
Docker
66 lines
1.7 KiB
Docker
# for more Dockerfile examples with Klipper see:
|
|
# https://github.com/sillyfrog/OctoPrint-Klipper-mjpg-Dockerfile
|
|
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://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-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
|
|
|
|
RUN /opt/octoprint/venv/bin/python -m pip install https://github.com/mmone/OctoPrintKlipper/archive/master.zip
|
|
|
|
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"]
|