From 8be70f0c804a87ac93d22c3c79326d68b645044c Mon Sep 17 00:00:00 2001 From: JayLiu <38887641+luky116@users.noreply.github.com> Date: Thu, 2 May 2024 21:12:20 +0800 Subject: [PATCH] fix start testcontainers fail bug (#1313) --- common/testcontainers/testcontainers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/testcontainers/testcontainers.go b/common/testcontainers/testcontainers.go index 83da6af59..327354d1f 100644 --- a/common/testcontainers/testcontainers.go +++ b/common/testcontainers/testcontainers.go @@ -31,6 +31,11 @@ type TestcontainerApps struct { // NewTestcontainerApps returns new instance of TestcontainerApps struct func NewTestcontainerApps() *TestcontainerApps { timestamp := time.Now().Nanosecond() + // In order to solve the problem of "creating reaper failed: failed to create container" + // refer to https://github.com/testcontainers/testcontainers-go/issues/2172 + if err := os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true"); err != nil { + panic("set env failed: " + err.Error()) + } return &TestcontainerApps{ Timestamp: timestamp, }