Topic: How to create Docker Image of MDB Angular 4 and 5 Pro Project?

ariful free asked 2 years ago


Project run successfully of Docker Image on Docker Desktop

Exception occurred during execute Docker build run command. eg: docker build -t eswiftangularpro .Error showing on terminal console:

 PS D:\projects\era\SWIFT Project\eSwift-Mdb4-Angular-Pro> docker build -t eswiftangularpro . 
[+] Building 833.9s (13/14)
 => [internal] load build definition from Dockerfile                                                              1.0s 
 => => transferring dockerfile: 270B                                                                              0.2s 
 => [internal] load .dockerignore                                                                                 0.7s 
 => => transferring context: 2B                                                                                   0.1s 
 => [internal] load metadata for docker.io/library/nginx:alpine                                                   5.3s 
 => [internal] load metadata for docker.io/library/node:latest                                                    8.6s 
 => [auth] library/node:pull token for registry-1.docker.io                                                       0.0s 
 => [auth] library/nginx:pull token for registry-1.docker.io                                                      0.0s 
 => [node 1/5] FROM docker.io/library/node:latest@sha256:1dc279d252907f5bcbe7fe708ae0fe95aa1aa15cfbc070d68e804  129.0s 
 => => resolve docker.io/library/node:latest@sha256:1dc279d252907f5bcbe7fe708ae0fe95aa1aa15cfbc070d68e804842b0d1  0.4s 
 => => sha256:1dc279d252907f5bcbe7fe708ae0fe95aa1aa15cfbc070d68e804842b0d16d67 1.21kB / 1.21kB                    0.0s 
 => => sha256:45f8f5b4ad535ca4a84f12ab1099fe25aec4615355a077ec9ac995a933714d76 2.21kB / 2.21kB                    0.0s 
 => => sha256:14777a723ec41f47fa4cf9d94f718217f8c2fe120e7ae102f56e9e8b4f0beffc 7.60kB / 7.60kB                    0.0s 
 => => sha256:9a7b024a8381db764cc48724c66ef77cf3036f9110ca53a2422a2f381d8daf44 44.47MB / 44.47MB                111.6s 
 => => sha256:22353d05d6e6a35fe0c3bbf9703a769ea0d2dbfe66a71e1dd22acb0b3aa313aa 2.27MB / 2.27MB                    9.9s 
 => => sha256:e4a00242c622c9caf4eb220e3b8498bd0a94fff6738b55f3ff4c7c8b17e80ec4 452B / 452B                        4.9s 
 => => extracting sha256:9a7b024a8381db764cc48724c66ef77cf3036f9110ca53a2422a2f381d8daf44                         2.4s 
 => => extracting sha256:22353d05d6e6a35fe0c3bbf9703a769ea0d2dbfe66a71e1dd22acb0b3aa313aa                         0.2s 
 => => extracting sha256:e4a00242c622c9caf4eb220e3b8498bd0a94fff6738b55f3ff4c7c8b17e80ec4                         0.0s 
 => [internal] load build context                                                                               617.6s 
 => => transferring context: 1.11GB                                                                             615.4s 
 => CACHED [stage-1 1/2] FROM docker.io/library/nginx:alpine@sha256:eb05700fe7baa6890b74278e39b66b2ed1326831f9ec  0.0s 
 => [node 2/5] WORKDIR /app                                                                                       7.2s 
 => [node 3/5] COPY . .                                                                                          47.4s 
 => [node 4/5] RUN npm install                                                                                  137.9s 
 => ERROR [node 5/5] RUN npm run build --prod                                                                    20.2s 
------
 > [node 5/5] RUN npm run build --prod:
#13 2.759
#13 2.759 > eSwiftMiddlewareApplication@11.0.0 build
#13 2.759 > ng build
#13 2.759
#13 7.772 Warning: Entry point 'angular-calendar' contains deep imports into '/app/node_modules/date-fns/sub_days/index', '/app/node_modules/date-fns/sub_weeks/index', '/app/node_modules/date-fns/sub_months/index', '/app/node_modules/date-fns/add_days/index', '/app/node_modules/date-fns/add_weeks/index', '/app/node_modules/date-fns/add_months/index', '/app/node_modules/date-fns/start_of_today/index', '/app/node_modules/date-fns/get_iso_week/index', '/app/node_modules/date-fns/is_same_day/index', '/app/node_modules/date-fns/set_date/index', '/app/node_modules/date-fns/set_month/index', '/app/node_modules/date-fns/set_year/index', '/app/node_modules/date-fns/get_date/index', '/app/node_modules/date-fns/get_month/index', '/app/node_modules/date-fns/get_year/index', '/app/node_modules/date-fns/difference_in_seconds/index', '/app/node_modules/date-fns/add_seconds/index', '/app/node_modules/date-fns/add_minutes/index'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
#13 17.52 - Generating browser application bundles...
#13 19.67 node:internal/crypto/hash:67
#13 19.67   this[kHandle] = new _Hash(algorithm, xofLen);
#13 19.67                   ^
#13 19.67
#13 19.67 Error: error:0308010C:digital envelope routines::unsupported
#13 19.67     at new Hash (node:internal/crypto/hash:67:19)
#13 19.67     at Object.createHash (node:crypto:130:10)
#13 19.67     at module.exports (/app/node_modules/webpack/lib/util/createHash.js:135:53)
#13 19.67     at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:417:16)
#13 19.67     at /app/node_modules/webpack/lib/NormalModule.js:452:10
#13 19.67     at /app/node_modules/webpack/lib/NormalModule.js:323:13
#13 19.67     at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11
#13 19.67     at /app/node_modules/loader-runner/lib/LoaderRunner.js:172:11
#13 19.67     at loadLoader (/app/node_modules/loader-runner/lib/loadLoader.js:32:11)
#13 19.67     at iteratePitchingLoaders (/app/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
#13 19.67     at runLoaders (/app/node_modules/loader-runner/lib/LoaderRunner.js:365:2)
#13 19.67     at NormalModule.doBuild (/app/node_modules/webpack/lib/NormalModule.js:295:3)
#13 19.67     at NormalModule.build (/app/node_modules/webpack/lib/NormalModule.js:446:15)
#13 19.67     at Compilation.buildModule (/app/node_modules/webpack/lib/Compilation.js:739:10)
#13 19.67     at /app/node_modules/webpack/lib/Compilation.js:1111:12
#13 19.67     at /app/node_modules/webpack/lib/NormalModuleFactory.js:409:6 {
#13 19.67   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
#13 19.67   library: 'digital envelope routines',
#13 19.67   reason: 'unsupported',
#13 19.67   code: 'ERR_OSSL_EVP_UNSUPPORTED'
#13 19.67 }
#13 19.67
#13 19.67 Node.js v17.3.1
------
executor failed running [/bin/sh -c npm run build --prod]: exit code: 1

Dockerfile:

# stage 1
FROM node:latest as node
# FROM node:16.13.1
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build --prod

# stage 2
FROM nginx:alpine
COPY --from=node /app/dist/eswift-mdb4-angular-pro /usr/share/nginx/html

Arkadiusz Idzikowski staff answered 2 years ago


It looks like you use node v16.13.1. Please make sure to use the Node.js version compatible with the Angular version used in your project.

https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB4 11.1.0
  • Device: Desktop PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No