Set default home value (#281)

* Set default home value

* Apply  default home value based on user for run commands

* rename default home function
This commit is contained in:
priyawadhwa
2018-08-10 12:58:07 -07:00
committed by GitHub
parent 52e9863810
commit 4e77fa000d
8 changed files with 120 additions and 8 deletions
+12
View File
@@ -65,6 +65,18 @@ func RetrieveSourceImage(index int, buildArgs []string, stages []instructions.St
return retrieveRemoteImage(currentBaseName)
}
// RetrieveConfigFile returns the config file for an image
func RetrieveConfigFile(sourceImage v1.Image) (*v1.ConfigFile, error) {
imageConfig, err := sourceImage.ConfigFile()
if err != nil {
return nil, err
}
if sourceImage == empty.Image {
imageConfig.Config.Env = constants.ScratchEnvVars
}
return imageConfig, nil
}
func tarballImage(index int) (v1.Image, error) {
tarPath := filepath.Join(constants.KanikoIntermediateStagesDir, strconv.Itoa(index))
logrus.Infof("Base image from previous stage %d found, using saved tar at path %s", index, tarPath)
+2 -1
View File
@@ -18,12 +18,13 @@ package util
import (
"bytes"
"testing"
"github.com/GoogleContainerTools/kaniko/testutil"
"github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/empty"
"github.com/moby/buildkit/frontend/dockerfile/instructions"
"github.com/moby/buildkit/frontend/dockerfile/parser"
"testing"
)
var (