mirror of https://github.com/docker/docs.git
Merge remote-tracking branch 'unclejack/194-high-image-compression'
This commit is contained in:
commit
0e1781af26
|
@ -15,6 +15,7 @@ const (
|
||||||
Uncompressed Compression = iota
|
Uncompressed Compression = iota
|
||||||
Bzip2
|
Bzip2
|
||||||
Gzip
|
Gzip
|
||||||
|
Xz
|
||||||
)
|
)
|
||||||
|
|
||||||
func (compression *Compression) Flag() string {
|
func (compression *Compression) Flag() string {
|
||||||
|
@ -23,6 +24,8 @@ func (compression *Compression) Flag() string {
|
||||||
return "j"
|
return "j"
|
||||||
case Gzip:
|
case Gzip:
|
||||||
return "z"
|
return "z"
|
||||||
|
case Xz:
|
||||||
|
return "J"
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,14 +272,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
|
// 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
|
// 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)
|
tmp, err := ioutil.ReadAll(layerData2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
layerLength := len(tmp)
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("Failed to generate layer archive: %s", err)
|
return fmt.Errorf("Failed to generate layer archive: %s", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue