puppetlabs-toy-chest / wash

Wide Area SHell: a cloud-native shell for bringing remote infrastructure to your terminal.
https://puppetlabs.github.io/wash
Apache License 2.0
180 stars 29 forks source link

Listing files in a docker container truncates them #595

Closed MikaelSmith closed 4 years ago

MikaelSmith commented 4 years ago

Listing files in a docker container truncates the file. For example, listing /etc/hosts ends up with

127.0.0.1   localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.18.0.2  a26f1f6%

when the actual content is

127.0.0.1   localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.18.0.2  a26f1f6d47d2
MikaelSmith commented 4 years ago

Tracking this down, it was introduced in https://github.com/puppetlabs/wash/commit/842b8e54f49152c172f686c5d66ffd9670e431cc. Using od -c showed Wash has CRLF instead of LF. https://github.com/moby/moby/issues/8513 was particularly illuminating.