Skip to content

Commit

Permalink
strip file times to make tarballs more reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
mxey committed Sep 26, 2019
1 parent 281ff98 commit c55cb0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/content/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"strings"
"time"

digest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down Expand Up @@ -55,6 +56,9 @@ func tarDirectory(root, prefix string, w io.Writer) error {
header.Gid = 0
header.Uname = ""
header.Gname = ""
header.ModTime = time.Time{}
header.AccessTime = time.Time{}
header.ChangeTime = time.Time{}

// Write file
if err := tw.WriteHeader(header); err != nil {
Expand Down

0 comments on commit c55cb0f

Please sign in to comment.