TestcontainersConfiguration constructor

TestcontainersConfiguration()

Creates a configuration object by reading from environment variables and ~/.testcontainers.properties.

This constructor is called once to initialise testcontainersConfig. You rarely need to call it directly unless you are constructing a fresh configuration for testing.

Implementation

TestcontainersConfiguration()
    : maxTries = _parseInt(
        'TC_MAX_TRIES',
        Platform.environment['TC_MAX_TRIES'] ?? '120',
      ),
      sleepTime = _parseDouble(
        'TC_POOLING_INTERVAL',
        Platform.environment['TC_POOLING_INTERVAL'] ?? '1',
      ),
      ryukImage = Platform.environment['RYUK_CONTAINER_IMAGE'] ??
          'testcontainers/ryuk:0.8.1',
      ryukReconnectionTimeout =
          Platform.environment['RYUK_RECONNECTION_TIMEOUT'] ?? '10s',
      tcHostOverride = Platform.environment['TC_HOST'] ??
          Platform.environment['TESTCONTAINERS_HOST_OVERRIDE'],
      connectionModeOverride = overriddenConnectionMode(),
      hubImageNamePrefix =
          Platform.environment['TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX'] ?? '',
      dockerAuthConfig = Platform.environment['DOCKER_AUTH_CONFIG'],
      tcProperties = readTcProperties();