You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.0 KiB

3 years ago
ARG NODE_VERSION=6.17.1
FROM mhart/alpine-node:${NODE_VERSION}
LABEL \
org.opencontainers.image.title="Docker Image of opencv4nodejs_webcam" \
org.opencontainers.image.authors="Swarmlab.io <rootapostolos@swarmlab.io>"
#ENV PATH=/usr/local/texlive/bin/x86_64-linuxmusl:/usr/local/texlive/2020/bin/x86_64-linuxmusl:${PATH}
ENV dockeruser node
3 years ago
ENV USERhome=${dockeruser}
ENV UID=12345
ENV GID=23456
3 years ago
RUN addgroup -S node \
3 years ago
&& adduser -D -g "" -h "/home/${USERhome}" -G "${USERhome}" -u "${UID}" "${USERhome}"
3 years ago
3 years ago
COPY \
setup.sh \
extrapackages \
3 years ago
repositories \
3 years ago
/root/
3 years ago
# -------- next line is in setup.sh ------
# ----------edit if not alpine ----------
# copy repositories /etc/apk/repositories
# --------------------------------------
3 years ago
RUN /root/setup.sh
# nodejs npm install --- opencv----- uncomment --------------------------
ARG USER1=node
ARG NODEPROJECT1=opencv4nodejs_webcam
3 years ago
#&& wget -q https://github.com/Itseez/opencv/archive/${OPENCV_VERSION}.zip -O opencv.zip \
#&& wget -q https://github.com/Itseez/opencv_contrib/archive/${OPENCV_VERSION}.zip -O opencv_contrib.zip \
#&& wget -q https://github.com/davisking/dlib/archive/v${DLIB_VERSION}.zip -O dlib.zip \
3 years ago
ENV USER1 ${USER1}
ENV NODEPROJECT ${NODEPROJECT1}
3 years ago
ARG OPENCV_VERSION=4.5.4
3 years ago
ARG DLIB_VERSION=master
ARG LIB_PREFIX='/usr/local'
ENV OPENCV_VERSION=${OPENCV_VERSION} \
DLIB_VERSION=${DLIB_VERSION} \
LIB_PREFIX=${LIB_PREFIX} \
OPENCV4NODEJS_DISABLE_AUTOBUILD=1 \
DLIB_INCLUDE_DIR='$LIB_PREFIX/include' \
DLIB_LIB_DIR='$LIB_PREFIX/lib'
COPY ${NODEPROJECT} /home/${USER1}/${NODEPROJECT}
RUN /home/${USER1}/${NODEPROJECT}/install-npm-opencv.sh
WORKDIR /home/${USER1}
RUN chown -R ${USER1}.${USER1} /home/${USER1}
USER ${USER1}
#RUN set -uex; \
# npm install;
USER root
USER ${USER1}
#RUN set -uex; \
# npm cache clean --force;
# --------------------------------------------------------
WORKDIR /home/${dockeruser}
VOLUME ["/home/${dockeruser}"]
CMD ["tail","-f","/dev/null"]