Fix layer compression regression
Fix layer compression regression

PR #15493 removed compression of layers when pushing them to a V2
registry. This this makes layer uploads larger than they should be.

This commit restores the compression. It uses an io.Pipe to turn the
gzip compressor output Writer into a Reader, so the ReadFrom method can
be used on the BlobWriter (which is very important for avoiding many
PATCH requests per layer).

Fixes #17209
Fixes #17038

Signed-off-by: Aaron Lehmann <8ecfc6017a87905413dcd7d63696a2a4c351b604@docker.com>

circleci/docker,solanolabs/docker,solanolabs/docker,makinacorpus/docker,solanolabs/docker,makinacorpus/docker,circleci/docker,makinacorpus/docker,circleci/docker