You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve documentation to include JNA configuration capabilities #1910
testcontainers appears to be using JNA to perform its magic. By default, JNA writes to /tmp/jna folder and tries to execute something from there.
On some environments, /tmp folder is mounted with noexec flag, which makes the whole process fail.
Could you please add a documentation section where you specify your usage of JNA (maybe it's coming from docker-java?) and adding a note that properties jna.tmpdir and java.io.tmpdir can be used to override the default value?
A sample error that might occur during build with wrong configuration is:
ERROR o.t.d.EnvironmentAndSystemPropertyClientProviderStrategy.test - ping failed with configuration Environment variables, system properties and defaults. Resolved:
[08:35:13][Step 2/5] dockerHost=unix:///var/run/docker.sock
[08:35:13][Step 2/5] apiVersion='{UNKNOWN_VERSION}'
[08:35:13][Step 2/5] registryUrl='https://index.docker.io/v1/'
[08:35:13][Step 2/5] registryUsername='xxx'
[08:35:13][Step 2/5] registryPassword='null'
[08:35:13][Step 2/5] registryEmail='null'
[08:35:13][Step 2/5] dockerConfig='DefaultDockerClientConfig[dockerHost=unix:///var/run/docker.sock,registryUsername=xxx,registryPassword=<null>,registryEmail=<null>,registryUrl=https://index.docker.io/v1/,dockerConfigPath=/home/xxx/.docker,sslConfig=<null>,apiVersion={UNKNOWN_VERSION},dockerConfig=<null>]'
[08:35:13][Step 2/5] due to java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /tmp/jna-100295547/jna9104525941980512569.tmp: /tmp/jna-100295547/jna9104525941980512569.tmp: failed to map segment from shared object: Operation not permitted
[08:35:13][Step 2/5] at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:68)
And I understand it is not directly your issue, but having a documentation section about it would help others in the future
Thanks @steghio, and sorry that you hit an issue. I think that a documentation update might be a good thing to do, but I think we should discuss exactly where this would fit into the docs first - we might need a new page, or it might be able to go into the system requirements section somewhere.
sure thanks. I could create a PR but I would please ask for directions regarding where to place this information. It is simply a paragraph saying you use JNA and those two properties are available to configure it in the end.
@steghio Hello! I have same issue too. Can you tell me, please, how to override this parameters jna.tmpdir and java.io.tmpdir from testcontainers?
I try this, but not override default values:
export JAVA_OPTS="-Djna.tmpdir=/some-tmp -Djava.io.tmpdir=/some-tmp"
is not guaranteed to work, it is not exactly the same as directly passing -Djna.tmpdir=/some-tmp -Djava.io.tmpdir=/some-tmp as additional parameters to whatever process you are running.
The reason for this, is that it depends on the JVM and application/processes you are running, whether they actually check for that variable and set those values. For example check this SO question
In my case I directly set those values as parameters in the command that would execute testcontainers and it works. I think you can try the same.
Hi! I'd like to work on this issue. If it's still relevant, I'll prepare a documentation update covering the JNA configuration and the jna.tmpdir / java.io.tmpdir properties.
Activity
rnorth commentedon Sep 30, 2019
Thanks @steghio, and sorry that you hit an issue. I think that a documentation update might be a good thing to do, but I think we should discuss exactly where this would fit into the docs first - we might need a new page, or it might be able to go into the system requirements section somewhere.
steghio commentedon Sep 30, 2019
Hello,
sure thanks. I could create a PR but I would please ask for directions regarding where to place this information. It is simply a paragraph saying you use JNA and those two properties are available to configure it in the end.
Cheers
maxotov commentedon Jan 16, 2020
@steghio Hello! I have same issue too. Can you tell me, please, how to override this parameters jna.tmpdir and java.io.tmpdir from testcontainers?
I try this, but not override default values:
export JAVA_OPTS="-Djna.tmpdir=/some-tmp -Djava.io.tmpdir=/some-tmp"
steghio commentedon Jan 16, 2020
@maxotov
is not guaranteed to work, it is not exactly the same as directly passing
-Djna.tmpdir=/some-tmp -Djava.io.tmpdir=/some-tmpas additional parameters to whatever process you are running.The reason for this, is that it depends on the JVM and application/processes you are running, whether they actually check for that variable and set those values. For example check this SO question
In my case I directly set those values as parameters in the command that would execute testcontainers and it works. I think you can try the same.
Cheers
Abdul-Rafy2005 commentedon Jul 14, 2026
Hi! I'd like to work on this issue. If it's still relevant, I'll prepare a documentation update covering the JNA configuration and the
jna.tmpdir/java.io.tmpdirproperties.AzazelSensei commentedon Sep 8, 2026
Opened a docs PR for this: #12068