docker dockerfile COPY failed: no source files were specified
- 创建Dockerfile
FROM centos
COPY /projects/archives/* /archives/
CMD cd /archives \
&& ./start
- 构建镜像
$ docker build -t archives:test .
- 出现错误
[root@instance-loafw0eo docker]# docker build -t archives:test .
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM centos
---> 470671670cac
Step 2/3 : COPY /projects/archives/* /archives/
COPY failed: no source files were specified
原因:docker build命令中有上下文概念,不能copy上下文之外的文件
参考:https://www.cnblogs.com/sparkdev/p/9573248.html
4. 修改Dockerfile
FROM centos
COPY ./* /archives/
CMD cd /archives \
&&am