testcontainers-go
testcontainers-go copied to clipboard
Add support for userns remapping
What does this PR do?
This PR adds the configuration values ryuk.userns / TESTCONTAINERS_RYUK_USER_NS, which will cause the ryuk container to run in the host user namespace instead of the default one. This is required because Ryuk mounts the Docker socket into the container and if this isn't done it will receive a permission denied error when trying to access it.
Why is it important?
Enable scenarios where the user namespace has been remapped.
Related issues
N/A
How to test this PR
Automatically testing this change is difficult because it requires changing the dockerd configuration.
- Configure the Docker daemon to use
--userns-remapaccording to this guide: https://docs.docker.com/engine/security/userns-remap/ - Set
TESTCONTAINERS_RYUK_USER_NStotrue - Run Ryuk