testcontainers / testcontainers-go

Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
https://golang.testcontainers.org
MIT License
3.36k stars 460 forks source link

[Feature]: Add support for Windows containers #948

Open pjanotti opened 1 year ago

pjanotti commented 1 year ago

Problem

(This is based on my experience with v0.19.0.)

testcontainers-go currently doesn't support "Windows containers": it has some hard-coded defaults that don't consider the possibility of Windows containers. Some examples:

Solution

Remove the hard-coded locations that are assuming Linux containers and make the proper decisions to have testcontainers-go working with Windows containers.

Benefit

Many projects using golang are intended to be multi-platform and not being able to have containers test with Windows containers limits that capability. This is beneficial to projects that do heavy multi-platform integration tests.

Alternatives

I tried to configure environment variables like DOCKER_HOST or use settings like SkipReaper to get this working but some of the values are hard-coded and completely block this path.

Side note: the testcontainers for .NET supports both Linux and Windows containers so there is already a good reference to look at to make implement this feature.

Would you like to help contributing this feature?

Yes

pellared commented 1 year ago

I see that Windows containers are supported by https://github.com/ory/dockertest so that it can be used as a reference implementation.

mdelapenya commented 1 year ago

Indeed. We are working on making Ryuk to be compatible with Windows containers (there is a community contribution on its way), and would love to have Testcontainers for Go working across all platforms, so I'm really happy this conversation was brought up.

@pjanotti feel free to reach out here or in our Slack for an eventual sync on what needs to be done.

Thanks!

abemedia commented 8 months ago

Hey guys, was wondering if there's any update on this?