Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda