NGINX fails at COPY –from=node /app/dist/comp-lib /usr/share/nginx/html,

COPY failed: stat /var/lib/docker/overlay2/1e9a0e53a11b406c13d4fc790336f37285927a1b87d1bac4d0e889c6d3cfed9b/merged/app/dist/comp-lib: no such file or directory

I tried running docker system prune, and restarted Docker a bunch of times. I also gave a shot at rm -rf /var/lib/docker in the docker VM, somehow that doesn’t remove the directory.

Node version: v10.15.1

Docker version: 18.09.2, build 6247962


# stage-1

FROM node as builder
COPY . .
RUN npm install
RUN npm run build

# stage -2

FROM nginx:alpine
COPY --from=node /app/dist/comp-lib /usr/share/nginx/html

I expect the build to be successful but the above mentioned is the error I’m experiencing.

Source: StackOverflow