testcontainers-go icon indicating copy to clipboard operation
testcontainers-go copied to clipboard

Add support for userns remapping

Open jan-walther opened this issue 1 year ago • 5 comments

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-remap according to this guide: https://docs.docker.com/engine/security/userns-remap/
  • Set TESTCONTAINERS_RYUK_USER_NS to true
  • Run Ryuk

jan-walther avatar Jun 18 '24 11:06 jan-walther