mirror of
https://github.com/moby/moby.git
synced 2025-07-29 07:21:35 +03:00
builder: Fix setting command with custom shell
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@ -6039,3 +6039,18 @@ func (s *DockerSuite) TestBuildLineErrorWithComments(c *check.C) {
|
||||
Err: "Dockerfile parse error line 5: Unknown instruction: NOINSTRUCTION",
|
||||
})
|
||||
}
|
||||
|
||||
// #31957
|
||||
func (s *DockerSuite) TestBuildSetCommandWithDefinedShell(c *check.C) {
|
||||
buildImageSuccessfully(c, "build1", build.WithDockerfile(`
|
||||
FROM busybox
|
||||
SHELL ["/bin/sh", "-c"]
|
||||
`))
|
||||
buildImageSuccessfully(c, "build2", build.WithDockerfile(`
|
||||
FROM build1
|
||||
CMD echo foo
|
||||
`))
|
||||
|
||||
out, _ := dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", "build2")
|
||||
c.Assert(strings.TrimSpace(out), checker.Equals, `["/bin/sh","-c","echo foo"]`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user