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

274
Vistas
multi stage docker build with nginx image

I'm trying to build an nginx image for a react project app.

Here is my Dockerfile:

FROM node:14-alpine as myapp
EXPOSE 3000
WORKDIR = /snakeapp
COPY package.json .
RUN yarn install --network-timeout 1000000
COPY . .
RUN yarn build

FROM nginx
COPY --from=myapp /snakeapp/build /usr/share/nginx/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]

The error I'm getting during the build image is:

...
Status: Downloaded newer image for nginx:latest
 ---> 08b152afcfae
Step 9/11 : COPY --from=myapp /snakeapp/build /usr/share/nginx/html
COPY failed: stat snakeapp/build: file does not exist

Could you please give me a hint which directory isn't existing.

If I create only the first image, the ls /snakeapp shows me the following content, as we can see the build file exist.

/= /snakeapp # ls
build              package-lock.json  src                yarn.lock
node_modules       package.json       webpack.config.js
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Did you notice the weird folder name /= /snakeapp? That's because of WORKDIR = .... Remove that =.

WORKDIR /snakeapp
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