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.
 
 
 
 

75 lines
2.0 KiB

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
ENV USERhome=${dockeruser}
ENV UID=12345
ENV GID=23456
RUN addgroup -S node \
&& adduser -D -g "" -h "/home/${USERhome}" -G "${USERhome}" -u "${UID}" "${USERhome}"
COPY \
setup.sh \
extrapackages \
repositories \
/root/
# -------- next line is in setup.sh ------
# ----------edit if not alpine ----------
# copy repositories /etc/apk/repositories
# --------------------------------------
RUN /root/setup.sh
# nodejs npm install --- opencv----- uncomment --------------------------
ARG USER1=node
ARG NODEPROJECT1=opencv4nodejs_webcam
#&& 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 \
ENV USER1 ${USER1}
ENV NODEPROJECT ${NODEPROJECT1}
ARG OPENCV_VERSION=4.5.4
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"]