Skip to content

Commit

Permalink
add octoprint
Browse files Browse the repository at this point in the history
fixes #73
fixes #71
  • Loading branch information
LongLiveCHIEF committed Sep 8, 2020
1 parent 99ec284 commit 080e084
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG OCTOPRINT_BASE_IMAGE
ARG PYTHON_BASE_IMAGE=3.8-slim-buster

FROM ubuntu AS s6build
ARG S6_RELEASE
Expand All @@ -18,7 +18,10 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& curl -fsSLO "https://github.com/just-containers/s6-overlay/releases/download/$S6_VERSION/s6-overlay-$ARCH.tar.gz"


FROM octoprint/octoprint:${OCTOPRINT_BASE_IMAGE} AS build
FROM python:${PYTHON_BASE_IMAGE} AS build

ARG tag
ENV tag ${tag:-master}

USER root

Expand Down Expand Up @@ -46,6 +49,17 @@ COPY --from=s6build /tmp /tmp
RUN s6tar=$(find /tmp -name "s6-overlay-*.tar.gz") \
&& tar xzf $s6tar -C /

# Install octoprint
RUN curl -fsSLO --compressed --retry 3 --retry-delay 10 \
https://github.com/OctoPrint/OctoPrint/archive/${tag}.tar.gz \
&& mkdir -p /opt/octoprint \
&& tar xzf ${tag}.tar.gz --strip-components 1 -C /opt/octoprint --no-same-owner

WORKDIR /opt/octoprint
RUN pip install -r requirements.txt
RUN python setup.py install
RUN ls -s ~/.octoprint /octoprint

# Install mjpg-streamer
RUN curl -fsSLO --compressed --retry 3 --retry-delay 10 \
https://github.com/jacksonliam/mjpg-streamer/archive/master.tar.gz \
Expand All @@ -60,6 +74,8 @@ RUN make install
COPY root /
ENV CAMERA_DEV /dev/video0
ENV MJPEG_STREAMER_INPUT -y -n -r 640x480
ENV PIP_USER true
ENV PYTHONUSERBASE /octoprint/plugins

# port to access haproxy frontend
EXPOSE 80
Expand Down

0 comments on commit 080e084

Please sign in to comment.