尽管构建上下文中存在源文件,但dockerfile COPY命令仍然失败。
$ docker --version
Docker version 1.4.1, build 5bc2ff8/1.4.1
Dockerfile:
$ cat Dockerfile
FROM centos
COPY "test", "/"
目录内容:
$ ls -Al
total 4
-rw-rw-r-- 1 nottingham nottingham 29 Apr 1 14:21 Dockerfile
-rw-rw-r-- 1 nottingham nottingham 0 Apr 1 14:26 test
构建输出:
$ docker build -t nottingham/test .
Sending build context to Docker daemon 2.56 kB
Sending build context to Docker daemon
Step 0 : FROM centos
---> 88f9454e60dd
Step 1 : COPY "test", "/"
INFO[0000] "test",: no such file or directory
使用COPY [src,dest]表单或ADD命令时会发生类似的错误。有什么想法吗?
答案 0 :(得分:3)
删除逗号和引号。使用:
FROM centos
COPY test /