Skip to content

Angular CLI Analytics ID causes Docker build to hang #25008

Closed

Description

@KevinDufendach

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

Angular 14

Description

I'm trying to build an Angular 15 project in Docker, but with CLI analytics enabled, the build always hangs at the RUN npm run build step and never completes.

Minimal Reproduction

See minimal reproduction here:
https://github.com/KevinDufendach/ng-15-docker-build-issue

This a fresh Angular 15.2.5 "ng new" project with the Dockerfile, .dockerignore, and nginx.conf copied from a working Angular 14 fresh install. Run "ng serve" and allowed usage analytics. Then, to reproduce, run the command:

docker build .

Dockerfile

FROM node:16-alpine as builder

COPY package.json package-lock.json ./
RUN npm set strict-ssl false
RUN npm ci && mkdir /app && mv ./node_modules ./app
WORKDIR /app
COPY . /app/

RUN npm run build # Builds successfully but never moves to next step

This can be fixed by setting the "cli" analytics to "false":

angular.json

"cli": {
  "analytics": false,
},

Fix mentioned here: https://stackoverflow.com/questions/75981611/how-do-i-fix-docker-getting-stuck-at-run-npm-run-build-with-angular-15/75999756#75999756

Exception or Error

No response

Your Environment

Angular CLI: 15.2.5
Node: 18.15.0
Package Manager: npm 9.2.0
OS: win32 x64

Angular: 15.2.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.5
@angular-devkit/build-angular   15.2.5
@angular-devkit/core            15.2.5
@angular-devkit/schematics      15.2.5
@angular/cli                    15.2.5
@schematics/angular             15.2.5
rxjs                            7.8.0
typescript                      4.9.5

Anything else relevant?

No response

Activity

  1. added
    needs: investigation
    on Apr 14, 2023
  2. self-assigned this
    on Apr 18, 2023
  3. added a commit that references this issue on Apr 18, 2023
    9f29eff
  4. added 3 commits that reference this issue on Apr 18, 2023
    c0a0f72
    f4a6dac
    bae6b28
  5. angular-automatic-lock-bot commented on May 19, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs: investigation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions