Skip to content

Commit 63ed6f5

Browse files
committed
feat[closes #37]: Use exec format for cmd
1 parent 0bc5cb2 commit 63ed6f5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

api/structs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Stage struct {
3434
Args map[string]string `json:"args"`
3535
Runs []string `json:"runs"`
3636
Expose map[string]string `json:"expose"`
37-
Cmd string `json:"cmd"`
37+
Cmd []string `json:"cmd"`
3838
Modules []interface{} `json:"modules"`
3939
Entrypoint []string
4040
}

core/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ func BuildContainerfile(recipe *api.Recipe) error {
214214
}
215215

216216
// CMD
217-
if stage.Cmd != "" {
217+
if len(stage.Cmd) > 0 {
218218
_, err = containerfile.WriteString(
219-
fmt.Sprintf("CMD %s\n", stage.Cmd),
219+
fmt.Sprintf("CMD [\"%s\"]\n", strings.Join(stage.Cmd, "\",\"")),
220220
)
221221
if err != nil {
222222
return err

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ require (
1818
github.com/vanilla-os/vib/api v0.0.0-20240331150207-852011e4d96f
1919
gopkg.in/yaml.v3 v3.0.1
2020
)
21+
22+
replace github.com/vanilla-os/vib/api => ./api

0 commit comments

Comments
 (0)