diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index e46d0f5585..fdfda8f9ef 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -3144,9 +3144,13 @@ func (s *DockerCLIBuildSuite) TestBuildClearCmd(c *testing.T) { ENTRYPOINT ["/bin/bash"] CMD []`)) - res := inspectFieldJSON(c, name, "Config.Cmd") - if res != "[]" { - c.Fatalf("Cmd %s, expected %s", res, "[]") + cmd := inspectFieldJSON(c, name, "Config.Cmd") + // OCI types specify `omitempty` JSON annotation which doesn't serialize + // empty arrays and the Cmd will not be present at all. + if testEnv.UsingSnapshotter() { + assert.Check(c, is.Equal(cmd, "null")) + } else { + assert.Check(c, is.Equal(cmd, "[]")) } }