rakibtg/docker-web-gui

docker build error

wendyliga opened this issue · 1 comments

got this error running docker build

> [6/6] RUN cd /src/backend && npm install:                                    
#10 11.57 npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated                                                                  
#10 11.58 npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated                                                               
#10 13.45 npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
#10 13.82 npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
#10 13.83 npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
#10 16.59 npm ERR! code 1
#10 16.59 npm ERR! path /src/backend/node_modules/sqlite3
#10 16.59 npm ERR! command failed
#10 16.59 npm ERR! command sh -c node-pre-gyp install --fallback-to-build
#10 16.59 npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/src/backend/node_modules/sqlite3/lib/binding/node-v102-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/src/backend/node_modules/sqlite3/lib/binding/node-v102-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
#10 16.59 npm ERR! node-pre-gyp info it worked if it ends with ok
#10 16.59 npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
#10 16.59 npm ERR! node-pre-gyp info using node@17.3.0 | linux | x64
#10 16.59 npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download 
#10 16.59 npm ERR! node-pre-gyp info check checked for "/src/backend/node_modules/sqlite3/lib/binding/node-v102-linux-x64/node_sqlite3.node" (not found)
#10 16.59 npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v102-linux-x64.tar.gz
#10 16.59 npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v102-linux-x64.tar.gz
#10 16.59 npm ERR! node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v102-linux-x64.tar.gz 
#10 16.59 npm ERR! node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@17.3.0 (node-v102 ABI, musl) (falling back to source compile with node-gyp) 
#10 16.59 npm ERR! node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v102-linux-x64.tar.gz 
#10 16.59 npm ERR! gyp info it worked if it ends with ok
#10 16.59 npm ERR! gyp info using node-gyp@8.4.1
#10 16.59 npm ERR! gyp info using node@17.3.0 | linux | x64
#10 16.59 npm ERR! gyp info ok 
#10 16.59 npm ERR! gyp info it worked if it ends with ok
#10 16.59 npm ERR! gyp info using node-gyp@8.4.1
#10 16.59 npm ERR! gyp info using node@17.3.0 | linux | x64
#10 16.60 npm ERR! gyp ERR! find Python 
#10 16.60 npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
#10 16.60 npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
#10 16.60 npm ERR! gyp ERR! find Python checking if "python3" can be used
#10 16.60 npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
#10 16.60 npm ERR! gyp ERR! find Python checking if "python" can be used
#10 16.60 npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
#10 16.60 npm ERR! gyp ERR! find Python 
#10 16.60 npm ERR! gyp ERR! find Python **********************************************************
#10 16.60 npm ERR! gyp ERR! find Python You need to install the latest version of Python.
#10 16.60 npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#10 16.60 npm ERR! gyp ERR! find Python you can try one of the following options:
#10 16.60 npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#10 16.60 npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
#10 16.60 npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
#10 16.60 npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
#10 16.60 npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#10 16.60 npm ERR! gyp ERR! find Python For more information consult the documentation at:
#10 16.60 npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#10 16.60 npm ERR! gyp ERR! find Python **********************************************************
#10 16.60 npm ERR! gyp ERR! find Python 
#10 16.60 npm ERR! gyp ERR! configure error 
#10 16.60 npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
#10 16.61 npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
#10 16.61 npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
#10 16.61 npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
#10 16.61 npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
#10 16.61 npm ERR! gyp ERR! stack     at exithandler (node:child_process:404:5)
#10 16.61 npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:416:5)
#10 16.61 npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
#10 16.61 npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
#10 16.61 npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:475:16)
#10 16.61 npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
#10 16.61 npm ERR! gyp ERR! System Linux 5.10.76-linuxkit
#10 16.61 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/src/backend/node_modules/sqlite3/lib/binding/node-v102-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/src/backend/node_modules/sqlite3/lib/binding/node-v102-linux-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v102"
#10 16.61 npm ERR! gyp ERR! cwd /src/backend/node_modules/sqlite3
#10 16.61 npm ERR! gyp ERR! node -v v17.3.0
#10 16.61 npm ERR! gyp ERR! node-gyp -v v8.4.1
#10 16.61 npm ERR! gyp ERR! not ok 
#10 16.61 npm ERR! node-pre-gyp ERR! build error 
#10 16.61 npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/src/backend/node_modules/sqlite3/lib/binding/node-v102-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/src/backend/node_modules/sqlite3/lib/binding/node-v102-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
#10 16.61 npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/src/backend/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
#10 16.61 npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
#10 16.61 npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1062:16)
#10 16.61 npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
#10 16.61 npm ERR! node-pre-gyp ERR! System Linux 5.10.76-linuxkit
#10 16.61 npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/src/backend/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
#10 16.61 npm ERR! node-pre-gyp ERR! cwd /src/backend/node_modules/sqlite3
#10 16.61 npm ERR! node-pre-gyp ERR! node -v v17.3.0
#10 16.61 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
#10 16.61 npm ERR! node-pre-gyp ERR! not ok
#10 16.61 
#10 16.61 npm ERR! A complete log of this run can be found in:
#10 16.61 npm ERR!     /root/.npm/_logs/2021-12-30T04_56_11_937Z-debug-0.log
------
executor failed running [/bin/sh -c cd /src/backend && npm install]: exit code: 1

use the following Dockerfile instead of the one in the repository:

FROM node:alpine
WORKDIR /src
ADD ./backend /src/backend
ADD ./client /src/client
ADD ./app.js /src/app.js
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python3 \
  && npm install --quiet node-gyp -g \
  && ln -s /usr/bin/python3 /usr/bin/python \
  && cd /src/backend && npm install --silent
CMD ["node", "/src/app.js"]
EXPOSE 3230