Why can't Docker see the file?

In the root directory of the project in the GitLab server, I created a directory called www and placed the two files package.json and index.js in it. The Dockerfile is as follows:

FROM node:latest
WORKDIR /usr/src/app
COPY ./www/package.json /usr/src/app/package.json
RUN npm install
COPY www /usr/src/app
CMD npm start

But I get the following error message:

[test1 3/5] COPY ./www/package.json /usr/src/app/package.json:
failed to solve: failed to compute cache key: failed to calculate checksum of ref 1d13a061-a8e0-4caf-be17-8c68d5914acf::xhv61z1c942fz8l8zrey1kw82: "/www/package.json": not found
ERROR: Job failed: exit status 1

What is wrong?


Have you read the error message you posted? The answer in there.

Yes and as I said, the files exist.