Docker Build Fails with No Such File or Directory Error

I’m trying to build a Docker image, but it fails with:

bash:

COPY failed: stat /var/lib/docker/tmp/...: no such file or directory

dockerfile:

FROM node:14
WORKDIR /app
COPY package.json .
RUN npm install
COPY . . 
CMD ["node", "server.js"]

Could this be a file path issue or a context problem?

Build context and filepaths are related. The files you copy must be defined relative to the build context, not to the Dockerfile.

IF you need more help, please, share your Docker version and how you build the image (docker build command or compose file)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.