I have the following dockerfile:
FROM nginx:1.21.3-alpine
COPY ./conf.d /etc/nginx/conf.d
RUN apk update && apk add git
RUN git clone https://username:token@github.com/username/test.com.git
RUN echo $(ls -l)
COPY ./test.com /usr/share/nginx/html
I am downloading the contents of the test repository. It contains the index.html file. Next, I try to copy the contents of the repository folder to the /usr/share/nginx/html folder, but I get the error:
COPY failed: file not found in build context or excluded by .dockerignore: stat test.com: file does not exist
I added the execution of the command ls -l and the list contains a test.com folder with the index.html file, but then why does the error occur?