add ustreamer; tweak moonraker and klipper dockerfiles

This commit is contained in:
Markus Küffner
2021-10-17 14:11:32 +02:00
parent 96485d8728
commit 9b4673335f
4 changed files with 69 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ services:
VERSION: 319c36df52eb016667d13ab006cae3752d0212e7
dockerfile: klipper.Dockerfile
context: .
target: klippy
target: run
container_name: klipper
restart: unless-stopped
volumes:
@@ -24,7 +24,7 @@ services:
build:
dockerfile: moonraker.Dockerfile
context: .
target: moonraker
target: run
container_name: moonraker
restart: unless-stopped
volumes:
@@ -42,6 +42,19 @@ services:
ports:
- 80:80
ustreamer:
image: ustreamer:latest
build:
dockerfile: ustreamer.Dockerfile
context: .
target: run
container_name: ustreamer
restart: unless-stopped
ports:
- 8080:8080
devices:
- /dev/video0:/dev/video0
volumes:
run:
gcode:

View File

@@ -16,7 +16,7 @@ RUN virtualenv -p python2 venv \
&& venv/bin/python klipper/klippy/chelper/__init__.py
## Runtime Image
FROM python:2-slim as klippy
FROM python:2-slim as run
WORKDIR /opt
COPY --from=build /opt/klipper ./klipper
@@ -46,4 +46,5 @@ RUN apt update \
libusb-dev \
avrdude gcc-avr binutils-avr avr-libc \
stm32flash libnewlib-arm-none-eabi \
gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0
gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0 \
&& apt clean

View File

@@ -14,7 +14,7 @@ RUN python -m venv venv \
&& venv/bin/pip install -r moonraker/scripts/moonraker-requirements.txt
## Runtime Image
FROM python:3-slim as moonraker
FROM python:3-slim as run
RUN apt update \
&& apt install -y \

50
ustreamer.Dockerfile Normal file
View File

@@ -0,0 +1,50 @@
## Get Code and make
FROM debian:buster-slim as build
ARG REPO=https://github.com/pikvm/ustreamer
ARG VERSION=master
WORKDIR /opt
RUN apt update \
&& apt install -y \
ca-certificates \
make \
gcc \
git \
libevent-dev \
libjpeg62-turbo-dev \
libbsd-dev \
libgpiod-dev \
&& apt clean
RUN git clone ${REPO} ustreamer \
&& cd ustreamer \
&& git checkout ${VERSION}
RUN cd ustreamer \
&& make
## Runtime Image
FROM debian:buster-slim as run
RUN apt update \
&& apt install -y \
ca-certificates \
libevent-2.1 \
libevent-pthreads-2.1-6 \
libjpeg62-turbo \
libbsd0 \
libgpiod2 \
&& apt clean
WORKDIR /opt
COPY --from=build /opt/ustreamer ./ustreamer
RUN groupadd ustreamer --gid 1000 \
&& useradd ustreamer --uid 1000 --gid ustreamer \
&& usermod ustreamer --append --groups video \
&& chown -R ustreamer:ustreamer /opt/*
USER ustreamer
ENTRYPOINT [ "/opt/ustreamer/ustreamer", "--host=0.0.0.0", "--port=8080", "--slowdown", "--device=/dev/video0", "--resolution=1280x960", "--format=MJPEG", "--desired-fps=30"]