Expected behavior
Using docker cp should copy files and directories from container to host with filenames greater than 100 characters for Docker version 18.06.1-ce and higher.
Actual behavior
Using docker cp container_name:/etc/resolv.conf a_very_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_long_filename_that_is_101_characters in 18.03.1-ce works but results in the error below on 18.06.1-ce and higher.
archive/tar: cannot encode header: Format specifies USTAR; and USTAR cannot encode Name="a_very_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_long_filename_that_is_101_characters"
Steps to reproduce the behavior
Output of docker version:
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Additional environment details (AWS, VirtualBox, physical, etc.)
I was able to reproduce the issue in Docker 18.06.1-ce and 18.09.0-ce but not in Docker 18.03.1-ce. The commands below can reproduce the issue. I reproduced the issue using CentOS 7.5 and Amazon Linux 2 hosts. I then used Vagrant to confirm the issue locally.
docker pull centos:7
docker run -d -i --name docker_test centos:7
docker cp docker_test:/etc/resolv.conf a_very_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_long_filename_that_is_100_characters
docker cp docker_test:/etc/resolv.conf a_very_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_long_filename_that_is_101_characters
It appears a change to Golang v1.10 may have changed the default archive/tar format to USTAR which has a 100 character Linkname limit.
https://golang.org/doc/go1.10#archive/tar
https://golang.org/pkg/archive/tar/#Format
Expected behavior
Using
docker cpshould copy files and directories from container to host with filenames greater than 100 characters for Docker version 18.06.1-ce and higher.Actual behavior
Using
docker cp container_name:/etc/resolv.conf a_very_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_long_filename_that_is_101_charactersin 18.03.1-ce works but results in the error below on 18.06.1-ce and higher.Steps to reproduce the behavior
Output of
docker version:Additional environment details (AWS, VirtualBox, physical, etc.)
I was able to reproduce the issue in Docker 18.06.1-ce and 18.09.0-ce but not in Docker 18.03.1-ce. The commands below can reproduce the issue. I reproduced the issue using CentOS 7.5 and Amazon Linux 2 hosts. I then used Vagrant to confirm the issue locally.
It appears a change to Golang v1.10 may have changed the default archive/tar format to USTAR which has a 100 character Linkname limit.
https://golang.org/doc/go1.10#archive/tar
https://golang.org/pkg/archive/tar/#Format