-
Notifications
You must be signed in to change notification settings - Fork 329
Open
Labels
Description
What are you trying to do?
I'm trying to run testcontainers on a host with Docker Engine API exposed via TCP socket instead of a Unix socket. Testcontainers run fine but ryuk fails to start because it wants to bind mount /var/run/docker.sock
into container.
Using unix socket and bind mounts is hardcoded here:
testcontainers-python/core/testcontainers/core/container.py
Lines 285 to 293 in e7feb53
Reaper._container = ( | |
DockerContainer(c.ryuk_image) | |
.with_name(f"testcontainers-ryuk-{SESSION_ID}") | |
.with_exposed_ports(8080) | |
.with_volume_mapping(c.ryuk_docker_socket, "/var/run/docker.sock", "rw") | |
.with_kwargs(privileged=c.ryuk_privileged, auto_remove=True) | |
.with_env("RYUK_RECONNECTION_TIMEOUT", c.ryuk_reconnection_timeout) | |
.start() | |
) |
Supporting mTLS TCP sockets would also be cool. mTLS support may be split off into another issue though.
Other references:
- Similar issue in testcontainers-java: [Bug]: Testcontainers forces Ryuk to use Unix sockets as Docker host, breaking environments which use a TCP socket testcontainers-java#9137