Updated created by time for built image

Should fix #312
This commit is contained in:
Priya Wadhwa 2018-08-29 16:56:42 -07:00
parent 49f92980d5
commit 3dddb82bed
1 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import (
"os"
"path/filepath"
"strconv"
"time"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1"
@ -150,6 +151,10 @@ func DoBuild(opts *options.KanikoOptions) (v1.Image, error) {
return nil, err
}
if finalStage {
sourceImage, err = mutate.CreatedAt(sourceImage, v1.Time{Time: time.Now()})
if err != nil {
return nil, err
}
if opts.Reproducible {
sourceImage, err = mutate.Canonical(sourceImage)
if err != nil {