-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Dockerfile for rpi-mjpg-streamer | ||
|
||
# https://www.balena.io/docs/reference/base-images/base-images-ref/ | ||
ARG RPI=raspberrypi3 | ||
|
||
FROM balenalib/$RPI-debian:latest | ||
|
||
COPY ./Docker/qemu-arm-* /usr/bin/ | ||
|
||
WORKDIR / | ||
|
||
# install packages | ||
RUN apt-get update -y && \ | ||
apt-get install -y build-essential libjpeg-dev imagemagick libv4l-dev git cmake uvcdynctrl libraspberrypi-bin | ||
|
||
# build mjpg-streamer | ||
RUN ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h && \ | ||
git clone https://github.com/jacksonliam/mjpg-streamer && \ | ||
cd mjpg-streamer/mjpg-streamer-experimental && \ | ||
cmake -DCMAKE_INSTALL_PREFIX:PATH=.. . && \ | ||
make install | ||
|
||
# copy rpi-mjpg-streamer files | ||
COPY ./ / | ||
|
||
# arguments (default values in `.env` file) | ||
ARG PORT | ||
ARG RESOLUTION | ||
ARG FPS | ||
ARG ANGLE | ||
ARG FLIPPED | ||
ARG MIRRORED | ||
ARG USERNAME | ||
ARG PASSWORD | ||
|
||
# environtment variables | ||
ENV PORT=${PORT} \ | ||
RESOLUTION=${RESOLUTION} \ | ||
FPS=${FPS} \ | ||
ANGLE=${ANGLE} \ | ||
FLIPPED=${FLIPPED} \ | ||
MIRRORED=${MIRRORED} \ | ||
USERNAME=${USERNAME} \ | ||
PASSWORD=${PASSWORD} | ||
|
||
# configure | ||
RUN echo "{'angle': ${ANGLE}, 'flipped': ${FLIPPED}, 'mirrored': ${MIRRORED}}" \ | ||
> /www/config.json | ||
|
||
# Open ports | ||
EXPOSE $PORT | ||
|
||
# Entry point for the built application | ||
ENTRYPOINT ["/run-mjpg-streamer.docker.sh"] |