From c1d869bdb54efa5d139be23f86e9a03efa764b53 Mon Sep 17 00:00:00 2001 From: unclejack Date: Tue, 2 Apr 2013 02:16:28 +0300 Subject: [PATCH 1/2] add support for xz compression This adds xz as a compression option. xz is alread supported by bsdtar without the external xz program. Upstream-commit: 3c5d2e4661e76e83e35637561153578ddd87f249 Component: engine --- components/engine/archive.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/engine/archive.go b/components/engine/archive.go index 0421c51768..d09d3d6b97 100644 --- a/components/engine/archive.go +++ b/components/engine/archive.go @@ -15,6 +15,7 @@ const ( Uncompressed Compression = iota Bzip2 Gzip + Xz ) func (compression *Compression) Flag() string { @@ -23,6 +24,8 @@ func (compression *Compression) Flag() string { return "j" case Gzip: return "z" + case Xz: + return "J" } return "" } From a700cb8847f6cbe4b164521d4efb5a27bd06e82a Mon Sep 17 00:00:00 2001 From: unclejack Date: Tue, 2 Apr 2013 02:19:34 +0300 Subject: [PATCH 2/2] use xz compression when pushing images to the registry This makes the xz compression the default. Upstream-commit: 0ddc6867fb86d2539bb19034844ac8c2369060c1 Component: engine --- components/engine/registry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/engine/registry.go b/components/engine/registry.go index f1d6801f5f..62b1fac094 100644 --- a/components/engine/registry.go +++ b/components/engine/registry.go @@ -267,14 +267,14 @@ func (graph *Graph) PushImage(stdout io.Writer, imgOrig *Image, authConfig *auth // FIXME: Don't do this :D. Check the S3 requierement and implement chunks of 5MB // FIXME2: I won't stress it enough, DON'T DO THIS! very high priority - layerData2, err := Tar(path.Join(graph.Root, img.Id, "layer"), Gzip) + layerData2, err := Tar(path.Join(graph.Root, img.Id, "layer"), Xz) tmp, err := ioutil.ReadAll(layerData2) if err != nil { return err } layerLength := len(tmp) - layerData, err := Tar(path.Join(graph.Root, img.Id, "layer"), Gzip) + layerData, err := Tar(path.Join(graph.Root, img.Id, "layer"), Xz) if err != nil { return fmt.Errorf("Failed to generate layer archive: %s", err) }