Skip to content

Commit 5609de3

Browse files
committed
Workaround and document weird docker issue
Signed-off-by: apostasie <[email protected]>
1 parent dbcc3bc commit 5609de3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/nerdctl/container/container_commit_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ func TestCommit(t *testing.T) {
3636
helpers.Anyhow("rmi", "-f", data.Identifier())
3737
},
3838
Setup: func(data test.Data, helpers test.Helpers) {
39+
// FIXME: short of pulling first, docker will fail to start the container.
40+
// Debugging shows container exited immediately. Nothing in the container logs. Not much in journalctl.
41+
// It is not clear what is happening.
42+
if nerdtest.IsDocker() {
43+
helpers.Ensure("pull", testutil.CommonImage)
44+
}
3945
helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage, "sleep", "infinity")
4046
nerdtest.EnsureContainerStarted(helpers, data.Identifier())
4147
helpers.Ensure("exec", data.Identifier(), "sh", "-euxc", `echo hello-test-commit > /foo`)
@@ -59,6 +65,10 @@ func TestCommit(t *testing.T) {
5965
helpers.Anyhow("rmi", "-f", data.Identifier())
6066
},
6167
Setup: func(data test.Data, helpers test.Helpers) {
68+
// See note above about docker failing.
69+
if nerdtest.IsDocker() {
70+
helpers.Ensure("pull", testutil.CommonImage)
71+
}
6272
helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage, "sleep", "infinity")
6373
nerdtest.EnsureContainerStarted(helpers, data.Identifier())
6474
helpers.Ensure("exec", data.Identifier(), "sh", "-euxc", `echo hello-test-commit > /foo`)

0 commit comments

Comments
 (0)