diff --git a/api/structs.go b/api/structs.go index f7ab4bd..3c95aaf 100644 --- a/api/structs.go +++ b/api/structs.go @@ -34,7 +34,7 @@ type Stage struct { Args map[string]string `json:"args"` Runs []string `json:"runs"` Expose map[string]string `json:"expose"` - Cmd string `json:"cmd"` + Cmd []string `json:"cmd"` Modules []interface{} `json:"modules"` Entrypoint []string } diff --git a/core/build.go b/core/build.go index 13a3eb3..45b1a79 100644 --- a/core/build.go +++ b/core/build.go @@ -214,9 +214,9 @@ func BuildContainerfile(recipe *api.Recipe) error { } // CMD - if stage.Cmd != "" { + if len(stage.Cmd) > 0 { _, err = containerfile.WriteString( - fmt.Sprintf("CMD %s\n", stage.Cmd), + fmt.Sprintf("CMD [\"%s\"]\n", strings.Join(stage.Cmd, "\",\"")), ) if err != nil { return err diff --git a/go.mod b/go.mod index 4595a35..d6996fe 100644 --- a/go.mod +++ b/go.mod @@ -18,3 +18,5 @@ require ( github.com/vanilla-os/vib/api v0.0.0-20240331150207-852011e4d96f gopkg.in/yaml.v3 v3.0.1 ) + +replace github.com/vanilla-os/vib/api => ./api \ No newline at end of file