Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from seanauff/dev-update
Browse files Browse the repository at this point in the history
Dev update
  • Loading branch information
seanauff authored May 14, 2020
2 parents 62dae2b + 3fa0968 commit ca9a59f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 771 deletions.
25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:2.7
FROM ubuntu:18.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -7,11 +7,15 @@ RUN apt-get update && \
gzip \
tar \
build-essential \
libjpeg62-turbo-dev \
imagemagick \
libv4l-dev \
cmake \
sudo
sudo \
ca-certificates \
unzip

# This is to allow the klipper install script to run without error
RUN ln -s /bin/true /bin/systemctl

# enable klipper to install by creating users
COPY klippy.sudoers /etc/sudoers.d/klippy
Expand All @@ -23,22 +27,20 @@ USER dwc2-klipper
WORKDIR /home/dwc2-klipper

RUN git clone https://github.com/KevinOConnor/klipper && \
./klipper/scripts/install-octopi.sh
./klipper/scripts/install-ubuntu-18.04.sh

RUN virtualenv ./klippy-env && \
./klippy-env/bin/pip install tornado==5.1.1

RUN git clone https://github.com/Stephan3/dwc2-for-klipper.git && \
RUN git clone https://github.com/pluuuk/dwc2-for-klipper.git && \
ln -s ~/dwc2-for-klipper/web_dwc2.py ~/klipper/klippy/extras/web_dwc2.py

#RUN rm klipper/klippy/gcode.py
COPY gcode.py klipper/klippy/

RUN mkdir -p /home/dwc2-klipper/sdcard/dwc2/web
RUN mkdir -p /home/dwc2-klipper/sdcard/dwc2/web && \
mkdir -p /home/dwc2-klipper/sdcard/sys

WORKDIR /home/dwc2-klipper/sdcard/dwc2/web

RUN wget https://github.com/chrishamm/DuetWebControl/releases/download/2.0.0-RC5/DuetWebControl.zip && \
RUN wget https://github.com/chrishamm/DuetWebControl/releases/download/2.1.7/DuetWebControl-SD.zip && \
unzip *.zip && for f_ in $(find . | grep '.gz');do gunzip ${f_};done

WORKDIR /home/dwc2-klipper
Expand All @@ -47,6 +49,9 @@ EXPOSE 4750

USER root

# Clean up hack for install script
RUN rm -f /bin/systemctl

COPY runklipper.py /

CMD ["/usr/bin/python","/runklipper.py"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ dwc2-klipper is a Docker image for running [DWC2] and [Klipper] 3d Printer contr

[DockerHub Image](https://hub.docker.com/r/seanauff/dwc2-klipper)

Because of recent changes to Klipper, this utilizes the fork from pluuuk as discussed [here](https://github.com/Stephan3/dwc2-for-klipper/issues/73).

## Prepare your printer.cfg file

Copy an appropriate config file from [here](https://github.com/KevinOConnor/klipper/tree/master/config) and add the following lines to it:
Expand Down Expand Up @@ -38,7 +40,7 @@ docker pull seanauff/dwc2-klipper:[tag]
Start the container:

```shell
docker run -d --device /dev/ttyUSB0:/dev/ttyUSB0 -v [some/path/on/host]:/home/dwc2-klipper/config seanauff/dwc2-klipper:[tag]
docker run -d --device /dev/ttyUSB0:/dev/ttyUSB0 -v [some/path/on/host]:/home/dwc2-klipper/config -p 4750:4750 seanauff/dwc2-klipper:[tag]
```

### Build the image yourself
Expand Down
14 changes: 14 additions & 0 deletions docker_compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '2'
services:
dwc2-klipper:
image: "seanauff/dwc2-klipper:arm"
container_name: "dwc2-klipper"
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
ports:
- "4750:4750"
volumes:
- "/home/pi/docker/dwc2-klipper:/home/dwc2-klipper/config"
environment:
TZ: America/New_York
restart: unless-stopped
Loading

0 comments on commit ca9a59f

Please sign in to comment.