diff --git a/cmd/nerdctl/container/container_commit_test.go b/cmd/nerdctl/container/container_commit_test.go index 9382a782d7a..144180f79c2 100644 --- a/cmd/nerdctl/container/container_commit_test.go +++ b/cmd/nerdctl/container/container_commit_test.go @@ -36,6 +36,12 @@ func TestCommit(t *testing.T) { helpers.Anyhow("rmi", "-f", data.Identifier()) }, Setup: func(data test.Data, helpers test.Helpers) { + // FIXME: short of pulling first, docker will fail to start the container. + // Debugging shows container exited immediately. Nothing in the container logs. Not much in journalctl. + // It is not clear what is happening. + if nerdtest.IsDocker() { + helpers.Ensure("pull", testutil.CommonImage) + } helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage, "sleep", "infinity") nerdtest.EnsureContainerStarted(helpers, data.Identifier()) helpers.Ensure("exec", data.Identifier(), "sh", "-euxc", `echo hello-test-commit > /foo`) @@ -59,6 +65,10 @@ func TestCommit(t *testing.T) { helpers.Anyhow("rmi", "-f", data.Identifier()) }, Setup: func(data test.Data, helpers test.Helpers) { + // See note above about docker failing. + if nerdtest.IsDocker() { + helpers.Ensure("pull", testutil.CommonImage) + } helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage, "sleep", "infinity") nerdtest.EnsureContainerStarted(helpers, data.Identifier()) helpers.Ensure("exec", data.Identifier(), "sh", "-euxc", `echo hello-test-commit > /foo`)