Skip to content

Commit ace7062

Browse files
committed
Use pigz instead of gzip if is installed
1 parent 3485cd6 commit ace7062

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/leeway/build.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,14 @@ func (p *Package) buildDocker(buildctx *buildContext, wd, result string) (res *p
13521352
if p.C.W.Provenance.Enabled {
13531353
pkgcmds = append(pkgcmds, []string{"tar", "fr", ef, "./" + provenanceBundleFilename})
13541354
}
1355-
pkgcmds = append(pkgcmds, []string{"gzip", ef})
1355+
1356+
compressor := "gzip"
1357+
pigz, err := exec.LookPath("pigz")
1358+
if err == nil {
1359+
compressor = pigz
1360+
}
1361+
1362+
pkgcmds = append(pkgcmds, []string{compressor, ef})
13561363
commands[PackageBuildPhasePackage] = pkgcmds
13571364
} else if len(cfg.Image) > 0 {
13581365
for _, img := range cfg.Image {

0 commit comments

Comments
 (0)