|
| 1 | +# supported build argument |
| 2 | +ARG DEBIAN_VARIANT=bullseye-slim |
| 3 | + |
| 4 | +# Download base image |
| 5 | +FROM debian:${DEBIAN_VARIANT} |
| 6 | + |
| 7 | +# re-reference supported argument and copy to environment var |
| 8 | +ARG DEBIAN_VARIANT |
| 9 | +ENV DEBIAN_VARIANT=${DEBIAN_VARIANT} |
| 10 | + |
| 11 | +ARG DEBIAN_FRONTEND=noninteractive |
| 12 | +ENV TZ=UTC |
| 13 | + |
| 14 | +# Refer https://github.com/jacksonliam/mjpg-streamer/issues/386 |
| 15 | +# This assumes a Debian build and references: |
| 16 | +# libjpeg62-turbo-dev |
| 17 | +# For Ubuntu, replace with: |
| 18 | +# libjpeg8-dev |
| 19 | + |
| 20 | +# acknowledgement: mostly borrowed from https://github.com/Cossey/docker |
| 21 | +RUN apt-get -q -y update \ |
| 22 | + && apt-get -q -y -o "DPkg::Options::=--force-confold" -o "DPkg::Options::=--force-confdef" install apt-utils \ |
| 23 | + && rm -rf /etc/dpkg/dpkg.cfg.d/excludes \ |
| 24 | + && apt-get -q -y -o "DPkg::Options::=--force-confold" -o "DPkg::Options::=--force-confdef" install \ |
| 25 | + cmake \ |
| 26 | + git \ |
| 27 | + gcc \ |
| 28 | + g++ \ |
| 29 | + libjpeg62-turbo-dev \ |
| 30 | + tzdata \ |
| 31 | + uuid-runtime \ |
| 32 | + && apt-get -q -y autoremove \ |
| 33 | + && apt-get -q -y clean \ |
| 34 | + && rm -rf /var/lib/apt/lists/* \ |
| 35 | + && git clone https://github.com/jacksonliam/mjpg-streamer.git /usr/src/mjpg-streamer \ |
| 36 | + && make -C /usr/src/mjpg-streamer/mjpg-streamer-experimental \ |
| 37 | + && make -C /usr/src/mjpg-streamer/mjpg-streamer-experimental install \ |
| 38 | + && rm -rf /usr/src/mjpg-streamer \ |
| 39 | + && apt-get -q -y -o "DPkg::Options::=--force-confold" -o "DPkg::Options::=--force-confdef" purge \ |
| 40 | + cmake \ |
| 41 | + git \ |
| 42 | + gcc \ |
| 43 | + g++ |
| 44 | + |
| 45 | +# set up the container start point |
| 46 | +ENV ENTRYPOINT_SCRIPT="docker-entrypoint.sh" |
| 47 | +COPY docker-entrypoint.sh /usr/local/bin |
| 48 | +RUN chmod 755 /usr/local/bin/docker-entrypoint.sh |
| 49 | + |
| 50 | +# starting point - self-repair (if ever needed) and launch |
| 51 | +ENTRYPOINT ["docker-entrypoint.sh"] |
| 52 | + |
| 53 | +# the streamer invocation |
| 54 | +CMD mjpg_streamer \ |
| 55 | + -i "/usr/local/lib/mjpg-streamer/input_uvc.so -d ${MJPG_STREAMER_INTERNAL_DEVICE} -n -f ${MJPG_STREAMER_FPS} -r ${MJPG_STREAMER_SIZE}" \ |
| 56 | + -o "/usr/local/lib/mjpg-streamer/output_http.so -p 80 -w /usr/local/share/mjpg-streamer/www ${MJPG_STREAMER_CREDENTIALS}" |
| 57 | + |
| 58 | +# set root's home directory as default (probably unnecessary) |
| 59 | +WORKDIR /root |
| 60 | + |
| 61 | +# port |
| 62 | +EXPOSE "80" |
| 63 | + |
| 64 | +# set container metadata |
| 65 | +LABEL com.github.SensorsIot.IOTstack.Dockerfile.build-args="${DEBIAN_VARIANT}" |
| 66 | +LABEL com.github.SensorsIot.IOTstack.Dockerfile.maintainer= "Paraphraser <[email protected]>" |
| 67 | + |
| 68 | +# EOF |
0 commit comments