Class EcrConfig


public class EcrConfig extends AbstractServiceConfig<EcrConfig.Builder>
Configuration for ECR-specific container settings.

Instances are created via EcrConfig.Builder:


 EcrConfig config = EcrConfig.builder()
     .enabled(true)
     .registryPortRange(5000, 100)
     .registryImage("registry:2")
     .build();
 
  • Method Details

    • builder

      public static EcrConfig.Builder builder()
      Returns a new EcrConfig.Builder for this configuration.
      Returns:
      a new builder
    • toBuilder

      public EcrConfig.Builder toBuilder()
      Returns a new EcrConfig.Builder for this configuration, initialized with the current values of this instance.
      Specified by:
      toBuilder in class AbstractServiceConfig<EcrConfig.Builder>
      Returns:
      a new builder pre-populated with this configuration's values
    • getRegistryImage

      public String getRegistryImage()
      Returns the Docker image used for the ECR registry.
      Returns:
      the registry image name
    • getRegistryContainerName

      public String getRegistryContainerName()
      Returns the container name for the ECR registry.
      Returns:
      the registry container name
    • getRegistryBasePort

      public int getRegistryBasePort()
      Returns the base port for the ECR registry port range.
      Returns:
      the base port
    • getRegistryPortsCount

      public int getRegistryPortsCount()
      Returns the number of ports allocated for the ECR registry, starting from getRegistryBasePort().
      Returns:
      the number of registry ports
    • getRegistryMaxPort

      public int getRegistryMaxPort()
      Returns the maximum port for the ECR registry port range.
      Returns:
      the maximum port
    • isTlsEnabled

      public boolean isTlsEnabled()
      Returns whether TLS is enabled for the ECR registry.
      Returns:
      true if TLS is enabled
    • getUriStyle

      public String getUriStyle()
      Returns the URI style for repositoryUri responses.
      Returns:
      "hostname" or "path"
    • getDockerNetwork

      public String getDockerNetwork()
      Returns the Docker network used for ECR registry containers, or null if not set.
      Returns:
      the Docker network name, or null
    • applyEnvVarsToContainer

      public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by setting the appropriate environment variables.
      Overrides:
      applyEnvVarsToContainer in class AbstractServiceConfig<EcrConfig.Builder>
      Parameters:
      container - the container to configure
    • applyExposedPortsToContainer

      public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by exposing the appropriate ports.
      Overrides:
      applyExposedPortsToContainer in class AbstractServiceConfig<EcrConfig.Builder>
      Parameters:
      container - the container to configure