mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-05 05:41:02 +02:00
Set root user to default home
This commit is contained in:
+1
-1
@@ -127,7 +127,7 @@ func addDefaultHOME(u string, envs []string) []string {
|
||||
}
|
||||
|
||||
// If user isn't set, set default value of HOME
|
||||
if u == "" {
|
||||
if u == "" || u == constants.RootUser {
|
||||
return append(envs, fmt.Sprintf("%s=%s", constants.HOME, constants.DefaultHOMEValue))
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ const (
|
||||
HOME = "HOME"
|
||||
// DefaultHOMEValue is the default value Docker sets for $HOME
|
||||
DefaultHOMEValue = "/root"
|
||||
RootUser = "root"
|
||||
|
||||
// Docker command names
|
||||
Cmd = "cmd"
|
||||
|
||||
Reference in New Issue
Block a user