mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
669c067798
This is a work base to introduce more features like build time dockerfile optimisations, dependency analysis and parallel build, as well as a first step to go from a dispatch-inline process to a frontend+backend process. Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
19 lines
541 B
Go
19 lines
541 B
Go
package instructions
|
|
|
|
import "strings"
|
|
|
|
// handleJSONArgs parses command passed to CMD, ENTRYPOINT, RUN and SHELL instruction in Dockerfile
|
|
// for exec form it returns untouched args slice
|
|
// for shell form it returns concatenated args as the first element of a slice
|
|
func handleJSONArgs(args []string, attributes map[string]bool) []string {
|
|
if len(args) == 0 {
|
|
return []string{}
|
|
}
|
|
|
|
if attributes != nil && attributes["json"] {
|
|
return args
|
|
}
|
|
|
|
// literal string command, not an exec array
|
|
return []string{strings.Join(args, " ")}
|
|
}
|