Fix exec form of HEALTHCHECK CMD

We attached the JSON flag to the wrong AST node, causing Docker to treat
the exec form ["binary", "arg"] as if the shell form "binary arg" had
been used. This failed if "ls" was not present.

Added a test to detect this.

Fixes #26174

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
Upstream-commit: e95b6b51daed868094c7b66113381d5088e831b4
Component: engine
This commit is contained in:
Thomas Leonard
2016-08-31 17:36:10 +01:00
parent c03a13f697
commit 22f7fc770f
2 changed files with 16 additions and 1 deletions

View File

@ -357,5 +357,5 @@ func parseHealthConfig(rest string, d *Directive) (*Node, map[string]bool, error
return nil, nil, err
}
return &Node{Value: typ, Next: cmd, Attributes: attrs}, nil, err
return &Node{Value: typ, Next: cmd}, attrs, err
}