Skip to content

Commit

Permalink
Make tar creation deterministic
Browse files Browse the repository at this point in the history
for that, we sort entries, override owner+group+mtime
and omit ctime+atime
  • Loading branch information
bmwiedemann authored and frelon committed Dec 2, 2024
1 parent 7116985 commit d9873c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/features/generate-tarballs.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main() {

fmt.Printf("Generate %s from %s\n", output, input)

cmd := exec.Command("tar", "-C", inputDir, "-czvf", output, input)
cmd := exec.Command("tar", "--sort=name", "--mtime=@1", "--owner=0", "--group=0", "--numeric-owner", "--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime", "-C", inputDir, "-czvf", output, input)

out, err := cmd.CombinedOutput()
if err != nil {
Expand Down

0 comments on commit d9873c8

Please sign in to comment.