Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kreuzwerker/terraform-provider-do…
Browse files Browse the repository at this point in the history
…cker
  • Loading branch information
mavogel committed May 23, 2021
2 parents b51f0b4 + 588c621 commit e73a057
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/provider/resource_docker_registry_image_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"path/filepath"
"strconv"
"strings"
"time"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
Expand Down Expand Up @@ -297,6 +298,16 @@ func buildDockerImageContextTar(buildContext string) (string, error) {
// update the name to correctly reflect the desired destination when untaring
header.Name = strings.TrimPrefix(strings.Replace(file, buildContext, "", -1), string(filepath.Separator))

// set archive metadata non deterministic
header.Mode = 0
header.Uid = 0
header.Gid = 0
header.Uname = ""
header.Gname = ""
header.ModTime = time.Time{}
header.AccessTime = time.Time{}
header.ChangeTime = time.Time{}

// write the header
if err := tw.WriteHeader(header); err != nil {
return err
Expand Down

0 comments on commit e73a057

Please sign in to comment.