Merge pull request #113 from kelseyhightower/gzip-compress-aci-files

actool: gzip application container image
This commit is contained in:
Kelsey Hightower
2014-12-02 02:07:50 -08:00
+8 -3
View File
@@ -2,6 +2,7 @@ package main
import (
"archive/tar"
"compress/gzip"
"io/ioutil"
"os"
"path/filepath"
@@ -122,15 +123,19 @@ func runBuild(args []string) (exit int) {
}
return 1
}
gw := gzip.NewWriter(fh)
tr := tar.NewWriter(gw)
defer func() {
tr.Close()
gw.Close()
fh.Close()
if exit != 0 && !buildOverwrite {
fh.Close()
os.Remove(tgt)
}
}()
tr := tar.NewWriter(fh)
var aw aci.ArchiveWriter
if buildFilesetName != "" {
aw, err = aci.NewFilesetWriter(buildFilesetName, tr)