【发布时间】:2022-01-12 13:32:47
【问题描述】:
我有以下 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
我正在下载测试存储库的内容。它包含 index.html 文件。接下来,我尝试将存储库文件夹的内容复制到 /usr/share/nginx/html 文件夹,但出现错误:
COPY failed: file not found in build context or excluded by .dockerignore: stat test.com: file does not exist
我添加了命令 ls -l 的执行,列表中包含一个 test.com 文件夹和 index.html 文件,但是为什么会出现错误呢?
【问题讨论】:
标签: docker dockerfile