dockerfile: set default shell based on OS
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>v0.8
parent
ecf070a027
commit
63856b6a36
|
@ -1353,7 +1353,7 @@ func withShell(img Image, args []string) []string {
|
|||
if len(img.Config.Shell) > 0 {
|
||||
shell = append([]string{}, img.Config.Shell...)
|
||||
} else {
|
||||
shell = defaultShell()
|
||||
shell = defaultShell(img.OS)
|
||||
}
|
||||
return append(shell, strings.Join(args, " "))
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package dockerfile2llb
|
||||
|
||||
func defaultShell(os string) []string {
|
||||
if os == "windows" {
|
||||
return []string{"cmd", "/S", "/C"}
|
||||
}
|
||||
return []string{"/bin/sh", "-c"}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
// +build !windows
|
||||
|
||||
package dockerfile2llb
|
||||
|
||||
func defaultShell() []string {
|
||||
return []string{"/bin/sh", "-c"}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
// +build windows
|
||||
|
||||
package dockerfile2llb
|
||||
|
||||
func defaultShell() []string {
|
||||
return []string{"cmd", "/S", "/C"}
|
||||
}
|
Loading…
Reference in New Issue