jason-liu22 / netflix-clone-react-typescript

Netflix Clone using React, Typescript, Material UI
https://netflix-clone-react-typescript.vercel.app
233 stars 920 forks source link

error while building with docker #5

Closed aimericdrk closed 1 year ago

aimericdrk commented 1 year ago

when i execute the docker build command i get this error :

[builder 7/7] RUN yarn build                                          63.1s
ERROR [stage-1 4/4] COPY --from=builder /app/build .                   0.0s
------
[stage-1 4/4] COPY --from=builder /app/build .:
------
Dockerfile:15
--------------------
  13 |     WORKDIR /usr/share/nginx/html
  14 |     RUN rm -rf ./*
  15 | >>> COPY --from=builder /app/build .
  16 |     ENTRYPOINT ["nginx", "-g", "daemon off;"]
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref moby::pjf9876vbhdsqid8qcifj: "/app/build": not found

is this normal / how can i fix it ?

jason-liu22 commented 1 year ago

Hi, thank you for reporting bug. Yes. It's a bug from Dockerfile I had coded the Dockerfile long time ago. I was using CRA at that time and CRA used build folder when building. But as you can see, I use Vite now and by default it uses dist instead of build. Dockerfile was using build. That's why you get the bug. I had never tested it after I migrated it with Vite. Now it's fixed. sorry and thanks again.