Open HofmeisterAn opened 1 year 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
ssh
tunnelAll 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
:
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?
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.
should this still be opened @HofmeisterAn ?
since qemu fixed their image
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.
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)
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.
/remindme 1year
🙃 (bad joke ok ...)
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.
Hi,
I'm facing problem when I create network with TC.
Steps too reproduce:
Result: Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"cause":"CNI network \"1ddde97e-1272-4bf4-82c3-4998f4ab8c08\" not found","message":"error configuring network namespace for container aaeba79b34ab9de814ea4fa586696d507d72d47fd566c147748321f7a1285873: CNI network \"1ddde97e-1272-4bf4-82c3-4998f4ab8c08\" not found","response":500}
Environment: TC version : 3.10.0 dotnet 8 debian 12
I'm not sure if this is podman or TC issue. Please let me know if I need to make changes.
apparently the default podman version in my distro is quite old (v3) I upgrade to v4.3.1 and I got it working.
thx :)
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.
Docker.DotNet
'sExtractArchiveToContainerAsync(string, ContainerPathStatParameters, Stream, CancellationToken)
throwsSystem.Net.Sockets.SocketException : Connection reset by peer
.When attempting to use the daemon socket path from within the Podman virtual machine, the process is also unsuccessful. Setting
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
fails:When running the Podman virtual machine with rootful privileges (
podman machine set --rootful=true
), the errors mentioned above do not occur. However, Testcontainers for .NET is either unable to establish a connection to the Resource Reaper or fails:TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
andTESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED=true
.K3sContainer
does not start (rancher/k3s:v1.26.2-k3s1
)LocalStackContainer
does not start (localstack/localstack:1.4
,localstack/localstack:2.0
)[ ] Failed test:
[ ] Failed test:
mtu
instead of thecom.docker.network.driver.mtu
key is used. Is themtu
a valid key for Docker (it is probably not that important since we only test if TC sets the property)?--hostname
,WithHostname(string)
), the ping commands fails withping: bad address '_container2'
. https://github.com/testcontainers/testcontainers-dotnet/blob/f0fef3ee3346665842426f1fe4bdead322c0097e/tests/Testcontainers.Tests/Unit/Networks/TestcontainersNetworkTest.cs#L47[x] Failed test:
This looks like a race condition after the tests are finished (disposing the container).
.DependsOn(new NetworkBuilder().Build())
works. The Podman "workaround" does not work with Docker.Solution
-
Benefit
-
Alternatives
-
Would you like to help contributing this enhancement?
Yes