testcontainers-dotnet icon indicating copy to clipboard operation
testcontainers-dotnet copied to clipboard

[Enhancement]: Support nerdctl and docker commands

Open kieronlanning opened this issue 2 years ago • 4 comments

Problem

Unable to use testcontainers when using nerdctl.

Tools such as Rancher Desktop allow you to choose between docker and nerdctl.

Solution

Support the nerdctl or docker command. The CLI command structures are identical to support compatibility.

Either through configuration or auto-detection (preferred) to allow developers running different local setups to still be able to run tests.

Benefit

Supports a wider range of developers.

Alternatives

N/A

Would you like to help contributing this enhancement?

Yes

kieronlanning avatar Mar 06 '23 08:03 kieronlanning

The CLI command structures are identical to support compatibility.

Do you know if nerdctl is Docker Engine API compatible? Testcontainers does not use the CLI implementation of Docker. It relies on Docker's Engine API.

HofmeisterAn avatar Mar 06 '23 08:03 HofmeisterAn

@HofmeisterAn I don't believe so... however, there are projects that bridge both:

https://github.com/afbjorklund/nerdctld found via https://github.com/containerd/nerdctl/issues/798

kieronlanning avatar Mar 06 '23 09:03 kieronlanning

Okay, this sounds similar to Podman support. I think the Podman developers use TC to test their API compatibility. Maybe that makes sense for nerdctl too. I am happy to continue with nerdctl support as soon as it is compatible.

HofmeisterAn avatar Mar 06 '23 11:03 HofmeisterAn

Wicked, thankyou.

kieronlanning avatar Mar 06 '23 12:03 kieronlanning