X Tutup
The Wayback Machine - https://web.archive.org/web/20260214114328/https://github.com/angular/angular-cli/issues/18581
Skip to content

Docker Image build failed on Angular 10Β #18581

@lamqson

Description

@lamqson

🐞 Bug report

Command (mark with an x)

docker build -t myapp

  • new
  • [ X] build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

I have not worked with other version yet. But I think it should have been working

Description

Docker build keeps failing

πŸ”¬ Minimal Reproduction

I have created a repo to re-produce it: https://github.com/lamqson/app-with-docker


1. install docker
2. run command: "docker build -t appwithdocker ."

πŸ”₯ Exception or Error



Generating ES5 bundles for differential loading...
An unhandled exception occurred: Call retries were exceeded
See "/tmp/ng-mfxP6m/angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! myapp@1.0.0 build:dev: `cp ${ENV:-'configs/env/.env.dev'} .env && ts-node set-env.ts && ng build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the myapp@1.0.0 build:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-08-19T16_44_53_152Z-debug.log
The command '/bin/sh -c npm run build:dev' returned a non-zero code: 1

🌍 Your Environment




     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.0.6
Node: 14.5.0
OS: darwin x64

Angular: 10.0.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.6
@angular-devkit/build-angular     0.1000.6
@angular-devkit/build-optimizer   0.1000.6
@angular-devkit/build-webpack     0.1000.6
@angular-devkit/core              10.0.5
@angular-devkit/schematics        10.0.5
@angular/cdk                      10.1.3
@angular/cli                      10.0.6
@angular/flex-layout              10.0.0-beta.32
@angular/google-maps              10.1.3
@angular/material                 10.1.3
@angular/youtube-player           10.1.3
@ngtools/webpack                  10.0.6
@schematics/angular               10.0.6
@schematics/update                0.1000.6
rxjs                              6.6.2
typescript                        3.9.7
webpack                           4.43.0

Dockerfile


FROM node:14.8.0
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install -g @angular/cli
RUN npm install
COPY . ./
RUN npm run build:dev
EXPOSE 8080
CMD [ "node", "server.js" ]

package.json


{
  "name": "",
  "version": "1.0.0",
  "scripts": {
    "config": "ts-node set-env.ts",
    "android": "tns run android --no-hmr",
    "ios": "tns run ios --no-hmr",
    "mobile": "tns run",
    "preview": "tns preview",
    "ngcc": "ngcc --properties es2015 module main --first-only",
    "postinstall": "npm run ngcc",
    "ng": "ng",
    "start": "cp ${ENV:-'configs/env/.env.dev'} .env && ts-node set-env.ts && node --max_old_space_size=4096 ./node_modules/.bin/ng serve -o",
    "build:dev": "cp ${ENV:-'configs/env/.env.dev'} .env && ts-node set-env.ts && ng build",
    "build:stg": "cp ${ENV:-'configs/env/.env.stg'} .env && ts-node set-env.ts && node --max_old_space_size=4096 ./node_modules/.bin/ng build",
    "build:prod": "cp ${ENV:-'configs/env/.env.prod'} .env && ts-node set-env.ts && node --max_old_space_size=4096 ./node_modules/.bin/ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "generate": "graphql-codegen"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "3.0.0-beta.0",
    "@angular-material-extensions/google-maps-autocomplete": "4.1.1",
    "@angular/animations": "10.0.11",
    "@angular/cdk": "10.1.3",
    "@angular/common": "10.0.11",
    "@angular/compiler": "10.0.11",
    "@angular/core": "10.0.11",
    "@angular/flex-layout": "10.0.0-beta.32",
    "@angular/forms": "10.0.11",
    "@angular/google-maps": "10.1.3",
    "@angular/material": "10.1.3",
    "@angular/platform-browser": "10.0.11",
    "@angular/platform-browser-dynamic": "10.0.11",
    "@angular/router": "10.0.11",
    "@angular/youtube-player": "10.1.3",
    "@apollo/client": "3.1.3",
    "@auth0/auth0-spa-js": "1.11.0",
    "@mdi/font": "5.5.55",
    "@nativescript/angular": "10.0.2",
    "@nativescript/core": "rc",
    "@nativescript/theme": "2.3.3",
    "@swimlane/ngx-charts": "14.0.0",
    "@syncfusion/ej2-angular-richtexteditor": "18.2.54",
    "@zxing/ngx-scanner": "3.0.0",
    "angular-in-memory-web-api": "0.11.0",
    "angular2-uuid": "1.1.1",
    "apollo-angular": "2.0.3",
    "apollo-angular-link-http": "1.11.0",
    "apollo-cache-inmemory": "1.6.6",
    "apollo-client": "2.6.10",
    "apollo-link-error": "1.1.13",
    "colors": "1.4.0",
    "dotenv": "8.2.0",
    "email-validator": "2.0.4",
    "graphql": "15.3.0",
    "moment": "2.27.0",
    "moment-timezone": "0.5.31",
    "nativescript-iqkeyboardmanager": "1.5.1",
    "nativescript-material-core": "3.2.19",
    "nativescript-social-share": "1.6.0",
    "nativescript-unit-test-runner": "0.7.0",
    "nativescript-accelerometer": "3.0.0",
    "nativescript-background-http": "4.2.1",
    "nativescript-camera": "4.5.0",
    "nativescript-image": "3.0.12",
    "nativescript-geolocation": "5.1.0",
    "nativescript-imagepicker": "7.1.0",
    "nativescript-intl": "4.0.1",
    "nativescript-theme-core": "2.0.24",
    "nativescript-ui-autocomplete": "7.0.1",
    "nativescript-ui-calendar": "7.0.1",
    "nativescript-ui-chart": "8.0.1",
    "nativescript-ui-dataform": "7.0.1",
    "nativescript-ui-gauge": "7.0.1",
    "nativescript-ui-listview": "9.0.1",
    "nativescript-ui-sidedrawer": "9.0.2",
    "ngx-input-file": "8.0.1",
    "ngx-pagination": "5.0.0",
    "ngx-perfect-scrollbar": "10.0.1",
    "ngx-spinner": "10.0.1",
    "ngx-swiper-wrapper": "9.0.1",
    "reflect-metadata": "0.1.13",
    "rxjs": "6.6.2",
    "tns-core-modules": "rc",
    "tslib": "2.0.1",
    "zone.js": "0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.1000.6",
    "@angular/cli": "10.0.6",
    "@angular/compiler-cli": "10.0.11",
    "@angular/language-service": "10.0.11",
    "@graphql-codegen/cli": "1.17.8",
    "@graphql-codegen/typescript": "1.17.8",
    "@graphql-codegen/typescript-apollo-angular": "2.0.1",
    "@graphql-codegen/typescript-operations": "1.17.8",
    "@nativescript/schematics": "10.0.2",
    "@nativescript/tslint-rules": "0.0.5",
    "@nativescript/webpack": "2.1.3",
    "@types/jasmine": "3.5.12",
    "@types/jasminewd2": "2.0.8",
    "@types/lodash": "4.14.159",
    "@types/moment": "2.13.0",
    "@types/moment-timezone": "0.5.30",
    "@types/node": "14.6.0",
    "@typescript-eslint/eslint-plugin": "3.9.1",
    "@typescript-eslint/parser": "3.9.1",
    "codelyzer": "6.0.0",
    "eslint": "7.7.0",
    "jasmine-core": "3.6.0",
    "jasmine-spec-reporter": "5.0.2",
    "karma": "5.1.1",
    "karma-chrome-launcher": "3.1.0",
    "karma-coverage-istanbul-reporter": "3.0.3",
    "karma-jasmine": "4.0.1",
    "karma-jasmine-html-reporter": "1.5.4",
    "protractor": "7.0.0",
    "ts-node": "8.10.2",
    "tslint": "6.1.3",
    "typescript": "3.9.7"
  },
  "nativescript": {
    "id": "org.nativescript.ngsample",
    "tns-ios": {
      "version": "6.5.2"
    },
    "tns-android": {
      "version": "6.5.3"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup