devsecopsmaturitymodel / DevSecOps-MaturityModel

GNU General Public License v3.0
463 stars 270 forks source link

Update Dockerfile #196

Closed corrupt closed 1 year ago

corrupt commented 1 year ago

Added node-gyp build dependencies in the builder stage to fix broken build process.

wurstbrot commented 1 year ago

@corrupt thank you for the PR. The build of an image with the Dockerfile is working for me. Please describe your error.

corrupt commented 1 year ago

Weird. I can't build using Rancher Desktop's moby to provide Docker.

Edit: output from docker build after docker system prune.

# git reset --hard origin/master
# docker build .
Sending build context to Docker daemon  498.4MB
Step 1/11 : FROM node:18.7-alpine AS build
 ---> 23a33ce67592
Step 2/11 : WORKDIR /usr/src/app
 ---> Running in 53875dce53a1
Removing intermediate container 53875dce53a1
 ---> 08cea5514f8e
Step 3/11 : COPY package.json package-lock.json ./
 ---> 2aa194efc32a
Step 4/11 : RUN npm install
 ---> Running in bae14fc2a96f
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm notice
npm notice New major version of npm available! 8.15.0 -> 9.3.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.3.1>
npm notice Run `npm install -g npm@9.3.1` to update!
npm notice
npm ERR! code 1
npm ERR! path /usr/src/app/node_modules/@parcel/watcher
npm ERR! command failed
npm ERR! command sh /tmp/install-3e394feb.sh
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@18.7.0 | linux | arm64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/src/app/node_modules/node-gyp/lib/find-python.js:330:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/src/app/node_modules/node-gyp/lib/find-python.js:159:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/src/app/node_modules/node-gyp/lib/find-python.js:202:16)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/src/app/node_modules/node-gyp/lib/find-python.js:294:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:418:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:430:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Linux 5.15.78-0-virt
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /usr/src/app/node_modules/@parcel/watcher
npm ERR! gyp ERR! node -v v18.7.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-01-18T09_00_43_778Z-debug-0.log
The command '/bin/sh -c npm install' returned a non-zero code: 1