Skip to content

Commit

Permalink
Workaround and document weird docker issue
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Oct 18, 2024
1 parent dbcc3bc commit 5609de3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/nerdctl/container/container_commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand All @@ -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`)
Expand Down

0 comments on commit 5609de3

Please sign in to comment.