Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
Angular12 Dockerization esbuild issue

I am trying to Dockerize my Angular12 app. I am able to Dockerize it fine when building using development as the environment. However, when building as production (production as default build and ng serve environment) I am getting some esbuild error on the npm run build section of the Dockerfile.

Here is the error log (the .... after MZ was some special undecipherable characters originally) :

#15 1.112 > ng build
#15 1.112
#15 4.377 - Generating browser application bundles (phase: setup)...
#15 17.18 /app/node_modules/@angular-devkit/build-angular/node_modules/esbuild/esbuild.exe: 1: /app/node_modules/@angular-devkit/build-angular/node_modules/esbuild/esbuild.exe: MZ....: not found
#15 17.18 /app/node_modules/@angular-devkit/build-angular/node_modules/esbuild/esbuild.exe: 3: /app/node_modules/@angular-devkit/build-angular/node_modules/esbuild/esbuild.exe: Syntax error: end of file unexpected (expecting ")")

Here is the Dockerfile:

FROM node:16.8.0 as build-step
RUN mkdir -p /app
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
RUN npm run build

FROM nginx:1.20.1
COPY --from=build-step /app/dist/my-app /usr/share/nginx/html
EXPOSE 4200:80
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If your application folder contains node_modules, try deleting it before starting the Dockerfile build, or exclude it from being copied into the container.

The reason it might fail is that the esbuild binary is environmentally dependent and the one that you use for your local environment may not necessarily work with the docker image.

Source: I had similar issue with building an application locally on my Macbook when it was working fine on my server.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda