Dockerfile COPY / ADD fails for file in build context

The dockerfile COPY command is failing despite the source file existing in the build context.

$ docker --version
Docker version 1.4.1, build 5bc2ff8/1.4.1

Dockerfile:

  • Jackrabbit with PostgreSQL backend leaves repository in inconsistent state
  • Run dockerd as with non-default group in centos6 as a service?
  • How and Where does the official docker image of postgreSQL persist its database
  • Run py.test in a docker container as a service
  • Get TeamCity running on Docker
  • How to deploy Mule Application on Kubernetes?
  • $ cat Dockerfile
    FROM centos
    COPY "test", "/"
    

    Directory contents:

    $ 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
    

    Build output:

    $ 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
    

    Similar errors occur when using the COPY [src, dest] form or the ADD command. Any ideas?

  • Mount git branches in a container
  • Getting error ImportMismatchError while running py.test
  • Docker run with “-v” create another shared directory
  • Shell variables in dockerfile missing in docker image labels
  • Persisting RabbitMQ Configuration in Docker Image
  • AWS Elastic Beanstalk deploying Docker with simple SpringBoot Eureka image failure
  • One Solution collect form web for “Dockerfile COPY / ADD fails for file in build context”

    Remove the comma and quotes. Use:

    FROM centos
    COPY test /
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.