构建上下文中的文件的 Dockerfile COPY / ADD 失败
Dockerfile COPY / ADD fails for file in build context
尽管构建上下文中存在源文件,但 dockerfile COPY 命令失败。
$ docker --version
Docker version 1.4.1, build 5bc2ff8/1.4.1
Docker 文件:
$ 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 命令时会出现类似的错误。有什么想法吗?
删除逗号和引号。使用:
FROM centos
COPY test /
尽管构建上下文中存在源文件,但 dockerfile COPY 命令失败。
$ docker --version
Docker version 1.4.1, build 5bc2ff8/1.4.1
Docker 文件:
$ 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 命令时会出现类似的错误。有什么想法吗?
删除逗号和引号。使用:
FROM centos
COPY test /