Testcontainers::DockerClient
DockerClient provides a singleton-like access to the Docr API client which communicates with the Docker daemon via the UNIX socket.
Constants
SESSION_ID = UUID.random.to_s
TESTCONTAINERS_LABEL = "org.testcontainers"
TESTCONTAINERS_LANG_LABEL = "#{TESTCONTAINERS_LABEL}.lang"
TESTCONTAINERS_SESSION_ID_LABEL = "#{TESTCONTAINERS_LABEL}.sessionId"
TESTCONTAINERS_VERSION_LABEL = "#{TESTCONTAINERS_LABEL}.version"
Class methods
api
Returns the shared Docr::API instance, creating it if needed.
The API instance uses the Docker socket at /var/run/docker.sock or the path specified by the DOCKER_HOST environment variable.
host
Returns the Docker host address.
Resolution order:
- TC_HOST environment variable
- DOCKER_HOST environment variable (parsed)
- "localhost" as fallback