Can Testcontainers itself be used from inside a container? #423
-
Hey, one question. I'm trying to run
Found this suggestion here Sibling docker containers But I get this exception
Is it even possible to run .net Testcontainers from inside docker? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 30 replies
-
Hm looks like it works if I disable Ryuk
|
Beta Was this translation helpful? Give feedback.
-
Yes, sibling containers are working. The var testcontainers = new TestcontainersBuilder<TestcontainersContainer>()
.WithImage("docker")
.WithCommand(KeepTestcontainersUpAndRunning.Command)
.WithBindMount("/var/run/docker.sock", "/var/run/docker.sock", AccessMode.ReadOnly)
.Build();
await testcontainers.StartAsync()
.ConfigureAwait(false);
var execResult = await testcontainers.ExecAsync(new[] { "docker", "ps" })
.ConfigureAwait(false);
This might happen if the default Unfortunately, you need to check out the repository. There is no option yet to change |
Beta Was this translation helpful? Give feedback.
Yes, sibling containers are working. The
ResourceReaper
use it as well. Following example incl. running the defaultResourceReaper
in the background works fine:execResult
contains the sibling containers: