You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is my Dockerfile derived from Dockerfile-debian. I just added ffmpeg support for opencv. Build is errorless, but then on run, I get this error ( please check below ).
Dockerfile:
FROM node:18 As build
RUN apt update && apt -y upgrade && apt -y install yasm nasm \
build-essential automake autoconf \
libtool pkg-config libcurl4-openssl-dev \
intltool libxml2-dev libgtk2.0-dev \
libnotify-dev libglib2.0-dev libevent-dev \
checkinstall
RUN wget https://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
RUN tar jxvf ffmpeg-snapshot.tar.bz2
WORKDIR /ffmpeg
RUN ls -liah
RUN ./configure --prefix=/usr
RUN cat RELEASE
RUN checkinstall
RUN dpkg --install ffmpeg_*.deb
RUN apt -y install build-essential libavformat-dev libavcodec-dev libswscale-dev libavresample-dev cmake
RUN ffmpeg -version
ENV OPENCV_BUILD_ROOT=/usr/src/opencv
ENV OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION=4.6.0
RUN npm install -g rimraf
RUN npm install -g @u4/opencv4nodejs
RUN rimraf /usr/local/lib/node_modules/**/*.{md,map,txt}
RUN rimraf /usr/local/lib/node_modules/{@eslint}
RUN rimraf /usr/local/lib/node_modules/**/{LICENSE,.github,.npmignore,LICENSE.txt,.travis.yml,.eslintrc,sponsors}
RUN rimraf /usr/local/lib/node_modules/*/test
RUN find /usr/local/lib/node_modules/ -type f -empty -print -delete
RUN find /usr/local/lib/node_modules/ -type d -empty -print -delete
RUN rimraf /usr/src/opencv/opencv-*/build/{doc,3rdparty,*.txt,*.cmake,*.tmp,tmp,downloads,opencv_python_tests.cfg}
RUN rimraf /usr/src/opencv/opencv-*/**/{cmake,*.txt,*.cmake,*.make,*.tmp,*.o,*.md,*.cpp,Makefile,CMakeFiles,*.sh}
RUN rimraf /usr/src/opencv/opencv-*/build/modules/.firstpass/
RUN rimraf /usr/src/opencv/opencv-*/build/share/opencv4/testdata
RUN rimraf /usr/src/opencv/opencv-*/build/share/
RUN find /usr/src/opencv/ -type f -empty -print -delete
RUN find /usr/src/opencv/ -type d -empty -print -delete
FROM node:18 As production
ENV OPENCV_BUILD_ROOT=/usr/src/opencv
ENV OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION=4.6.0
WORKDIR /usr/src/app
COPY --from=build /usr/src/opencv /usr/src/opencv
COPY --from=build /usr/local/lib/node_modules/@u4 /usr/local/lib/node_modules/@u4
RUN mkdir -p /var/app
WORKDIR /var/app
RUN npm install pm2 -g
RUN pm2 ls
COPY package.json ./
COPY ./bin .
RUN npm remove @u4/opencv4nodejs
RUN npm install
RUN npm link @u4/opencv4nodejs
EXPOSE 12002
ENTRYPOINT /var/app/docker-entrypoint-bwh.sh
/usr/local/lib/node_modules/@u4/opencv4nodejs/lib/cvloader.js:62
throw err;
^
Error: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
at Module._extensions..node (node:internal/modules/cjs/loader:1338:18)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at getOpenCV (/usr/local/lib/node_modules/@u4/opencv4nodejs/lib/cvloader.js:54:23)
at loadOpenCV (/usr/local/lib/node_modules/@u4/opencv4nodejs/lib/opencv4nodejs.js:6:48)
at Object.<anonymous> (/usr/local/lib/node_modules/@u4/opencv4nodejs/lib/opencv4nodejs.js:21:12)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) {
code: 'ERR_DLOPEN_FAILED'
}
The text was updated successfully, but these errors were encountered:
Below is my Dockerfile derived from Dockerfile-debian. I just added ffmpeg support for opencv. Build is errorless, but then on run, I get this error ( please check below ).
Dockerfile:
Node js code:
Runtime ERROR:
The text was updated successfully, but these errors were encountered: