Hello Docker community,
I am kind a noob (still learning) but hoping to get some help.
Few weeks ago, I followed a tutorial building images
My environment was
Windows 10
Node –version 14.17.1
Npm –version 7.17.1
Dockerfile
Stage 0, “build-stage”, based on Node.js, to build and compile the frontend
FROM node:latest as build-stage
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
ARG configuration=production
RUN npm run build – --output-path=./dist/out --configuration $configuration
Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.15
#Copy ci-dashboard-dist
COPY --from=build-stage /app/dist/out/ /usr/share/nginx/html
#Copy default nginx configuration to production sb
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
Imaged built successfully
Last week I could no longer build the same image. Searching Mr. google, there were many recommendations, including upgrade to node 14.18.1. that did not work either, luckily, I had a snapshot of windows but to my surprised that did not work either with same error.
I have completely removed/uninstall everything (control panel, folders, registries–reboot) and re-install latest
Node -v v16.13.1
npm -v 7.19.1
BUT same error
=> [build-stage 5/6] COPY ./ /app/ 15.8s
=> ERROR [build-stage 6/6] RUN npm run build – --output-path=./dist/out --configuration production 17.2s
[build-stage 6/6] RUN npm run build – --output-path=./dist/out --configuration production:
#14 2.906
#14 2.906 > angular-demo@0.0.0 build
#14 2.906 > ng build “–output-path=./dist/out” “–configuration” “production”
#14 2.906
#14 2.983 Node.js version v17.3.0 detected.
#14 2.983 Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see https://nodejs.org/en/about/releases/.
#14 7.044 - Generating browser application bundles (phase: setup)…
#14 16.49 node:internal/crypto/hash:67
#14 16.49 this[kHandle] = new _Hash(algorithm, xofLen);
#14 16.49 Error: error:0308010C:digital envelope routines::unsupported
#14 16.49 at new Hash (node:internal/crypto/hash:67:19)
#14 16.49 at Object.createHash (node:crypto:130:10)
#14 16.49 at BulkUpdateDecorator.hashFactory (/app/node_modules/webpack/lib/util/createHash.js:145:18)
#14 16.49 at BulkUpdateDecorator.update (/app/node_modules/webpack/lib/util/createHash.js:46:50)
#14 16.49 at RawSource.updateHash (/app/node_modules/webpack/node_modules/webpack-sources/lib/RawSource.js:64:8)
#14 16.49 at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:868:17)
#14 16.49 at handleParseResult (/app/node_modules/webpack/lib/NormalModule.js:934:10)
#14 16.49 at /app/node_modules/webpack/lib/NormalModule.js:1026:4
#14 16.49 at processResult (/app/node_modules/webpack/lib/NormalModule.js:743:11)
#14 16.49 at /app/node_modules/webpack/lib/NormalModule.js:807:5 {
#14 16.49 opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
#14 16.49 library: ‘digital envelope routines’,
#14 16.49 reason: ‘unsupported’,
#14 16.49 code: ‘ERR_OSSL_EVP_UNSUPPORTED’
#14 16.49 }
#14 16.49
#14 16.49 Node.js v17.3.0
executor failed running [/bin/sh -c npm run build – --output-path=./dist/out --configuration $configuration]: exit code: 1
The error shows node detected v17.3.0, not sure if this is part of the root-casue
Many thanks in advanced