Class TestContainerImages

java.lang.Object
org.mockserver.test.TestContainerImages

public final class TestContainerImages extends Object
Single source of truth for the container image references used by the Docker-gated test suites, with optional indirection through an ECR pull-through cache.

The public image names and tags live in ONE place — org/mockserver/test/test-container-images.properties on the classpath, read here by the Java suites and by .buildkite/scripts/lib/test-images.sh on the CI host — so the test constants and the pre-pull call sites can no longer drift out of sync (the drift risk flagged when the two were duplicated).

Registry indirection. When MOCKSERVER_TEST_IMAGE_REGISTRY (environment variable) or mockserver.test.image.registry (system property) is set to a registry host, every reference is rewritten to that registry's pull-through cache repository. CI sets it to the mockserver-build account's regional ECR host so pulls stay in-region and the upstream registries (quay.io, Docker Hub, mcr.microsoft.com) are contacted only on a first cache miss. Left unset — the default for local developers and forks, which have no ECR access — the public names are used verbatim, so those environments are completely unaffected.

The rewrite here MUST stay in lockstep with resolve_test_image in test-images.sh and the ecr_repository_prefix values in terraform/buildkite-agents/ecr-pull-through-cache.tf. The two CACHED upstreams and their ECR prefixes, plus the one unsupported passthrough:

   quay.io           -> quay/<path>         quay.io/minio/minio          -> <reg>/quay/minio/minio
   Docker Hub        -> docker-hub/<path>   fsouza/fake-gcs-server       -> <reg>/docker-hub/fsouza/fake-gcs-server
                                              rabbitmq (official)          -> <reg>/docker-hub/library/rabbitmq
   mcr.microsoft.com -> UNCHANGED           mcr.microsoft.com/.../azurite -> mcr.microsoft.com/azure-storage/azurite
 
mcr.microsoft.com is not a supported ECR pull-through upstream, so azurite always pulls direct from Microsoft (passthrough); every other unmapped host is rejected so a new registry cannot be silently mis-cached.
  • Field Details

    • REGISTRY_ENV

      public static final String REGISTRY_ENV
      Environment variable that, when set, points image references at an ECR pull-through cache registry host.
      See Also:
    • REGISTRY_PROPERTY

      public static final String REGISTRY_PROPERTY
      System-property equivalent of REGISTRY_ENV (env takes precedence).
      See Also:
    • MINIO

      public static final String MINIO
      quay.io/minio/minio.
    • FAKE_GCS_SERVER

      public static final String FAKE_GCS_SERVER
      fsouza/fake-gcs-server.
    • AZURITE

      public static final String AZURITE
      mcr.microsoft.com/azure-storage/azurite.
    • CP_KAFKA

      public static final String CP_KAFKA
      confluentinc/cp-kafka.
    • RABBITMQ

      public static final String RABBITMQ
      rabbitmq (Docker Hub official image).
    • ECLIPSE_MOSQUITTO

      public static final String ECLIPSE_MOSQUITTO
      eclipse-mosquitto (Docker Hub official image).
  • Method Details

    • resolve

      public static String resolve(String key)
      The image reference for key, rewritten to the configured ECR pull-through cache registry when one is set, otherwise the public name.
      Throws:
      IllegalArgumentException - if key is not in the properties file
    • publicRepository

      public static String publicRepository(String key)
      The PUBLIC repository (host/path without the tag) for key, for use as the argument to Testcontainers' asCompatibleSubstituteFor(...) so specialised containers (Kafka, RabbitMQ) accept a rewritten image name.