-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support TestContainers #7927
Comments
Can you link any current issues that need to be resolved here? |
"//var/run/docker.sock" is not setup dynamically when API start. |
You need to install podman-docker, for this to happen. |
Hey @rhatdan, does it mean that all known issues with Podman and Testcontainers are fixed now and that 100% of TC's test suite passes with Podman? 🎉 |
I have no idea. But we need specific issues reported to what is broken. No one on the Podman team is concentrating on testing TestContainers. Community members have been taking the lead on this, and reporting issues, that we will attempt to fix ASAP. |
I was able to successfully run test involving postgresql db using podman built from 2.2.0.RC1 with fixes from #8440, #8429 and #8423 podman (rootless) started with
test containers started with following environment variables set
Test containers version 1.14.3 or 1.15.0 |
Does it means podman API do not provide a docker compatible socket? Applying changes to /usr/lib/systemd/user/podman.service with ... and updating maven build configuration with
... and running podman api using command give the following build result in maven test phase
Is there something wrong in my configuration? |
@ruddy32 your comment does not provide enough information so anybody can provide you some useful help. General hints based on your comment
|
I was using podman 2.1.1, which does not include last changes listed by @psakar :-( |
I was able to successfully run my Spring Boot test involving PostgreSQL with podman 2.2.0-dev (4fe7c3f) and testcontainers 1.15.0 after introducing a third environment variable [1] in addition to the ones @psakar specified:
Also, my testcontainers setup completely ignored any normal location for testcontainers environment variables [1] and I had to set them in the Run/Debug Configurations of IntelliJ for the test. Otherwise, the environment variables would never be picked up by EnvironmentAndSystemPropertyClientProviderStrategy for whatever reason. -- EDIT 2 -- The following approach also worked for me after I learned about I could not use
-- EDIT 3 -- Adding a reference to [1] https://www.testcontainers.org/features/configuration/#configuration-locations |
Running podman 2.2.1 with systemctl --user start podman.service Installing host with podman-docker 2.2.1. Configuring maven 3.6.3 build with <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<environmentVariables>
<DOCKER_HOST>unix:///run/user/1000/podman/podman.sock</DOCKER_HOST>
<TESTCONTAINERS_RYUK_DISABLED>false</TESTCONTAINERS_RYUK_DISABLED>
<api.version>v2</api.version>
...
</environmentVariables>
</configuration>
</plugin> Running ERROR] fakeTest Time elapsed: 0.009 s <<< ERROR!
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
Caused by: java.lang.reflect.InvocationTargetException
...
Caused by: com.github.dockerjava.api.exception.InternalServerErrorException:
Status 500: {"cause":"incorrect volume format, should be [host-dir:]ctr-dir[:option]","message":"fill out specgen: unix:///run/user/1000/podman/podman.sock:/var/run/docker.sock:rw: incorrect volume format, should be [host-dir:]ctr-dir[:option]","response":500} DockerJava concat both DOCKER_HOST definition and '/var/run/docker.sock' instead of using DOCKER_HOST definition only ( It seems to be a problem with DockerJava or TestContainer host configuration. Could it be a problem with Podman host configuration? |
Providing the JSON payload for the failing container create call would be greatly helpful here - seems likely that Testcontainers is sending valid JSON but we're not parsing the volumes bit correctly. |
The container used is KeyCloack 10 and 11. How to capture JSON payload? |
You can use |
Maybe can help: testcontainers/testcontainers-java#2088 (comment) |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
This is a follow-up of testcontainers/testcontainers-java#2088.
It would be nice if podman could be used with TestContainers.
The text was updated successfully, but these errors were encountered: