diff options
author | sillyfrog <816454+sillyfrog@users.noreply.github.com> | 2018-08-07 03:11:01 +1000 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2018-08-06 13:11:01 -0400 |
commit | ed011b5f25a85c5a421f41c397679d1ae41d17b7 (patch) | |
tree | 2b83e9e77368763f5387a854f3a8a31ac0580380 /scripts/Dockerfile | |
parent | 7783767c35c5924819ef0dc06e5e62a8d5c85698 (diff) | |
download | kutter-ed011b5f25a85c5a421f41c397679d1ae41d17b7.tar.gz kutter-ed011b5f25a85c5a421f41c397679d1ae41d17b7.tar.xz kutter-ed011b5f25a85c5a421f41c397679d1ae41d17b7.zip |
dockerfile: Add a basic reference Dockerfile (#488)
Dockerfile: Add a basic reference Dockerfile
This is a sample of how to get Klipper running in Docker, because of the
virtual serial port, the user will have to modify things to include
something to send the GCode. I have included a link to my repo which has
OctoPrint up and running as an example.
Signed-off-by: Trent Davis <tgh@sillyfrog.com>
Diffstat (limited to 'scripts/Dockerfile')
-rw-r--r-- | scripts/Dockerfile | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/Dockerfile b/scripts/Dockerfile new file mode 100644 index 00000000..3752cd92 --- /dev/null +++ b/scripts/Dockerfile @@ -0,0 +1,38 @@ +# This is an example Dockerfile showing how it's possible to install Klipper in Docker. +# IMPORTANT: This Dockerfile must be moved to the repo root directory before building. +# Note that the host still needs to run Linux to connect the printers serial port to +# the container. +# When running, the serial port of your printer should be connected, including an +# argument such as: +# --device /dev/ttyUSB0:/dev/ttyUSB0 +# It's also required that your control program (eg: OctoPrint) be included in the same +# container as Docker does not allow sharing of the virtual serial port outside the +# container. +# The config should be in a file named "printer.cfg" in a directory mounted at: +# /home/klippy/.config/ +# For more Dockerfile examples with Klipper (and Octoprint) see: +# https://github.com/sillyfrog/OctoPrint-Klipper-mjpg-Dockerfile +FROM debian + +RUN apt-get update && \ + apt-get install -y sudo + +# Create user +RUN useradd -ms /bin/bash klippy && adduser klippy dialout +USER klippy + +#This fixes issues with the volume command setting wrong permissions +RUN mkdir /home/klippy/.config +VOLUME /home/klippy/.config + +### Klipper setup ### +WORKDIR /home/klippy + +COPY . klipper/ +USER root +RUN echo 'klippy ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/klippy && \ + chown klippy:klippy -R klipper +USER klippy +RUN ./klipper/scripts/install-octopi.sh + +CMD ["/home/klippy/klippy-env/bin/python", "/home/klippy/klipper/klippy/klippy.py", "/home/klippy/.config/printer.cfg"] |