feat(server): Apply GZIP compression to all image layers

This fixes #62
This commit is contained in:
Vincent Ambo 2019-10-11 01:28:38 +01:00 committed by Vincent Ambo
parent bf2718cebb
commit 0693e371d6
4 changed files with 15 additions and 9 deletions

View file

@ -15,7 +15,7 @@ const (
// media types
manifestType = "application/vnd.docker.distribution.manifest.v2+json"
layerType = "application/vnd.docker.image.rootfs.diff.tar"
layerType = "application/vnd.docker.image.rootfs.diff.tar.gzip"
configType = "application/vnd.docker.container.image.v1+json"
// image config constants
@ -102,7 +102,7 @@ func Manifest(layers []Entry) (json.RawMessage, ConfigLayer) {
hashes := make([]string, len(layers))
for i, l := range layers {
l.MediaType = "application/vnd.docker.image.rootfs.diff.tar"
l.MediaType = layerType
layers[i] = l
hashes[i] = l.Digest
}