diff --git a/Dockerfile b/Dockerfile index c9efdd6..f0bf2e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ WORKDIR / # install packages RUN apt-get update -y && \ - apt-get install -y build-essential libjpeg8-dev imagemagick libv4l-dev git cmake uvcdynctrl libraspberrypi-bin + 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 && \ diff --git a/Dockerfile-QEMU-ARM b/Dockerfile-QEMU-ARM new file mode 100644 index 0000000..2743220 --- /dev/null +++ b/Dockerfile-QEMU-ARM @@ -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"] diff --git a/README.md b/README.md index 41efdf6..b55ccc6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ $ sudo raspi-config ```bash $ sudo apt-get update -$ sudo apt-get install build-essential libjpeg8-dev imagemagick libv4l-dev git cmake uvcdynctrl +$ sudo apt-get install build-essential libjpeg-dev imagemagick libv4l-dev git cmake uvcdynctrl ``` ### Build mjpg-streamer