docker cp -L --follow-link fails to dereference file link #21146
Labels
area/cli
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
version/1.10
BUG REPORT INFORMATION
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Running
docker dind
Steps to reproduce the issue:
test
in local host directory.>mkdir test
test
calledfile
whose content isfile
.>echo 'file' >test/file
test
calledsubdir
.>mkdir test/subdir
test/subdir
calledfileLinked
that refers to/test/file
.>ln -s /test/file /test/subdir/fileLinked
>ls -al /test/subdir/fileLinked
>docker create -it alpine sh
7. Copy test/subdir to container root
/
and specify -L or --follow-link option.>docker cp --follow-link /test/subdir 858a81c497b7:/
8. Start and attach to the container.
>docker start -i 858a81c497b7
9. From container command line verify link was dereferenced.
Describe the results you received:
/subdir/fileLinked
remained a symbolic link when copied into a container.Describe the results you expected:
As described in cp documentation If you specify the -L option, docker cp follows any symbolic link in the SRC_PATH. Also see #16613. Follow link option typically replaces the symbolic link with a copy of the actual file.
Additional information you deem important (e.g. issue happens only occasionally):
Also occurs when container is SRC_PATH and SRC_PATH directory contains a symbolically linked file.
The text was updated successfully, but these errors were encountered: