-
Notifications
You must be signed in to change notification settings - Fork 28
/
Dockerfile.KlipperOctoprint
49 lines (34 loc) · 1.29 KB
/
Dockerfile.KlipperOctoprint
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
48
49
# for more Dockerfile examples with Klipper see:
# https://github.com/sillyfrog/OctoPrint-Klipper-mjpg-Dockerfile
FROM ubuntu:18.04
EXPOSE 8080
RUN apt-get update && \
apt-get install -y git python-virtualenv python-dev build-essential ffmpeg sudo
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/python setup.py install
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
# This is to allow the install script to run without error
RUN ln -s /bin/true /bin/systemctl
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-ubuntu-18.04.sh \
&& sudo rm -f /bin/systemctl
COPY klippyoctostart.py /
CMD ["/klippyoctostart.py"]