mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-09 13:45:46 +02:00
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:
@@ -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)
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user