testcontainers / testcontainers/testcontainers-java

Improve documentation to include JNA configuration capabilities

Open Beginner friendly
#1,910 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted resolution/acknowledged
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Hi all,

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 and cheers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no documentation file or test. Start by locating the existing configuration or troubleshooting documentation and confirming whether JNA arrives through docker-java; add the requested JNA usage and tmpdir guidance, including the noexec symptom, then check that the new section renders with the surrounding docs.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.