forked from OctoPrint/octoprint-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:2.7
EXPOSE 5000
LABEL maintainer "Charles Gunzelman"
ENV CURA_VERSION=15.04.6
ARG tag=master
WORKDIR /opt/octoprint
# In case of alpine
#RUN apk update && apk upgrade \
# && apk add --no-cache bash git openssh gcc\
# && pip install virtualenv \
# && rm -rf /var/cache/apk/*
#install ffmpeg
RUN cd /tmp \
&& wget -O ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-i686-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
COPY ./comm.py /opt/octoprint/src/octoprint/util/comm.py
RUN virtualenv venv && ./venv/bin/python setup.py install
VOLUME /home/octoprint/.octoprint
CMD ["/opt/octoprint/venv/bin/octoprint", "serve"]