Merge pull request #592 from tonistiigi/run-entrypoint
dockerfile: never use entrypoint for run commandsdocker-18.09
commit
94cc96a0ed
|
@ -572,8 +572,6 @@ func dispatchRun(d *dispatchState, c *instructions.RunCommand, proxy *llb.ProxyE
|
|||
var args []string = c.CmdLine
|
||||
if c.PrependShell {
|
||||
args = withShell(d.image, args)
|
||||
} else if d.image.Config.Entrypoint != nil {
|
||||
args = append(d.image.Config.Entrypoint, args...)
|
||||
}
|
||||
opt := []llb.RunOption{llb.Args(args)}
|
||||
for _, arg := range d.buildArgs {
|
||||
|
|
|
@ -75,9 +75,39 @@ func TestIntegration(t *testing.T) {
|
|||
testPlatformArgsExplicit,
|
||||
testExportMultiPlatform,
|
||||
testQuotedMetaArgs,
|
||||
testIgnoreEntrypoint,
|
||||
})
|
||||
}
|
||||
|
||||
func testIgnoreEntrypoint(t *testing.T, sb integration.Sandbox) {
|
||||
t.Parallel()
|
||||
|
||||
dockerfile := []byte(`
|
||||
FROM busybox
|
||||
ENTRYPOINT ["/nosuchcmd"]
|
||||
RUN ["ls"]
|
||||
`)
|
||||
|
||||
dir, err := tmpdir(
|
||||
fstest.CreateFile("Dockerfile", dockerfile, 0600),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
c, err := client.New(context.TODO(), sb.Address())
|
||||
require.NoError(t, err)
|
||||
defer c.Close()
|
||||
|
||||
_, err = c.Solve(context.TODO(), nil, client.SolveOpt{
|
||||
Frontend: "dockerfile.v0",
|
||||
LocalDirs: map[string]string{
|
||||
builder.LocalNameDockerfile: dir,
|
||||
builder.LocalNameContext: dir,
|
||||
},
|
||||
}, nil)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func testQuotedMetaArgs(t *testing.T, sb integration.Sandbox) {
|
||||
t.Parallel()
|
||||
|
||||
|
|
Loading…
Reference in New Issue