Skip to content

Commit

Permalink
feat[closes #37]: Use exec format for cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
axtloss committed Apr 21, 2024
1 parent 0bc5cb2 commit 63ed6f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 63ed6f5

Please sign in to comment.