Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
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 answers
Answer question

0

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

WORKDIR /snakeapp
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!