From 5f004d29eab0dcd71954b41b94fa560b40642415 Mon Sep 17 00:00:00 2001 From: apostasie Date: Fri, 18 Oct 2024 13:07:42 -0700 Subject: [PATCH] Workaround and document weird docker issue Signed-off-by: apostasie --- cmd/nerdctl/container/container_commit_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/nerdctl/container/container_commit_test.go b/cmd/nerdctl/container/container_commit_test.go index 9382a782d7a..738fbb65c64 100644 --- a/cmd/nerdctl/container/container_commit_test.go +++ b/cmd/nerdctl/container/container_commit_test.go @@ -36,6 +36,10 @@ 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. + 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 +63,8 @@ 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. + 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`)