For Netty implementation DockerClient.copyFileFromContainerCmd().exec() and DockerClient.copyArchiveFromContainerCmd().exec() returns InputStream that skips all 0xFF bytes. This results in malformed downloaded tar archives.
Check HttpResponseStreamHandler.java:84 where current.readByte() may return -1 which for InputStream.read() means there is no more data because the end of the stream has been reached. Could be fixed with returning current.readByte() & 0xFF.
For Netty implementation
DockerClient.copyFileFromContainerCmd().exec()andDockerClient.copyArchiveFromContainerCmd().exec()returnsInputStreamthat skips all 0xFF bytes. This results in malformed downloaded tar archives.Check HttpResponseStreamHandler.java:84 where
current.readByte()may return-1which forInputStream.read()means there is no more data because the end of the stream has been reached. Could be fixed with returningcurrent.readByte() & 0xFF.