Until https://github.com/moby/moby/issues/41827 is resolved this code causes chaos to unfold on machines and causes servers to be non-terminatable. This logic was intially changed to logical purposes, but this io.Copy logic works perfectly fine (even if not immediately intuitive).