Skip to content

Unable to copy existing file from container if it shares name with binded volume #9787

@akrpic77

Description

@akrpic77

Unable to copy file /temp.a from a container when binded volume /temp is present.
Tested also with other filenames and paths, seems like docker cp can't find container's file
if it shares begining of the name with binded volume.

Environment:

$ docker --version
Docker version 1.4.1, build 5bc2ff8
$ uname -a
Linux ak-devel 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt2-1~bpo70+1 (2014-12-08) x86_64 GNU/Linux

Reproduce with:

$ CT=$(docker run -d -v /tmp:/temp debian sleep infinity)
$ docker exec $CT touch /temp.a
$ docker cp $CT:/temp.a .
FATA[0000] Error response from daemon: Could not find the file /temp.a in container 24d546ffe7f697cc9567df1767a0965ce605ce453e5dcd4bc4aa86a3dc1c6cd3
$ docker exec $CT ls -l /temp.a
-rw-r--r-- 1 root root 0 Dec 23 13:49 /temp.a
$ docker exec $CT mv /temp.a /Temp.a
$ docker cp $CT:/Temp.a .
(no error - file copied)

Metadata

Metadata

Assignees

No one assigned

    Labels

    exp/expertkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions