testcontainers / testcontainers-dotnet

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
https://dotnet.testcontainers.org
MIT License
3.74k stars 265 forks source link

[Enhancement]: Extending Testcontainers to support multiple container runtimes (Podman) #876

Open HofmeisterAn opened 1 year ago

HofmeisterAn commented 1 year ago

Problem

Since Testcontainers for Node has done an awesome job supporting multiple container runtimes (not just Docker), it makes perfect sense to continue this great work and look into implementing it for .NET. We can start by collecting a list of tasks, issues or incompabilities that are necessary to support other runtimes as well.

Solution

-

Benefit

-

Alternatives

-

Would you like to help contributing this enhancement?

Yes

tebeco commented 7 months ago

Context: Apple MacBook Pro M3 - ARM Podman installed

might be a pre-requisite:

brew update
brew upgrade

# this is because QEMU had a bug since mid december / january that pulled an x86 image on ARM
# this is likely fixed and force a full re-creation
podman machine stop
podman machine rm
podman machine init

podman machine start

All I had to do was:

$ echo "ryuk.container.privileged = true" >> $HOME/.testcontainers.properties
$ cat $HOME/.testcontainers.properties

ryuk.container.privileged = true
$

and from podman Dashboard enable Docker compatibility:

image
kanpov commented 3 months ago

I've tried using Testcontainers with Podman via a simple ln /run/user/1000/podman/podman.sock /run/user/1000/docker.sock and so far it works exactly as well as with Docker, so are the issues only related to tests or are there any functional hindrances?

HofmeisterAn commented 3 months ago

so are the issues only related to tests or are there any functional hindrances?

The issues are not just related to the tests in this repository. Depending on your Podman environment and configuration, they can happen their as well.

tebeco commented 3 weeks ago

should this still be opened @HofmeisterAn ?

since qemu fixed their image

HofmeisterAn commented 3 weeks ago

I'm not sure, but in my opinion, we should keep the issue open until we have a working GitHub workflow that supports Podman. I haven't recently tested TC for .NET with Podman, I don't know which features are working and which are not.

tebeco commented 2 weeks ago

i fail to understand the relation between "testcontainer works with podman"✅ versus "adding a github workflow integration feature (to testcontainer withpod man")⚒️

that second one seems like an integration evol one that needs to be created as "proposal" while the second one seems working (this ticket)

HofmeisterAn commented 2 weeks ago

I think there are still a few issues that prevent Testcontainers for .NET from working properly with Podman, or at least obstacles. Ideally, this issue addresses the Podman incompatibilities (failing tests) and establishes a proper GH workflow (incl. updating the docs and explain which steps are necessary to set it up). Otherwise, we cannot know which features are working, which are not, and which may break with newer versions.

tebeco commented 2 weeks ago

/remindme 1year

🙃 (bad joke ok ...)

mdx0111 commented 5 hours ago

To get it working on Fedora 40, I ran the following command echo "ryuk.container.privileged = true" >> $HOME/.testcontainers.properties

Then ran this ln /run/user/1000/podman/podman.sock /run/user/1000/docker.sock

And everything started working nicely.