{"record":{"id":"3c41b4498f162699","repo":"testcontainers/testcontainers-java","slug":"is-not-supported-anymore-after-7-10-2-please-switch-to","errorCode":null,"errorMessage":"{} is not supported anymore after 7.10.2. Please switch to {}","messagePattern":"(.+?) is not supported anymore after 7\\.10\\.2\\. Please switch to (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/elasticsearch/src/main/java/org/testcontainers/elasticsearch/ElasticsearchContainer.java","lineNumber":104,"sourceCode":"     *\n     * @param dockerImageName Full docker image name as a {@link String}, like: docker.elastic.co/elasticsearch/elasticsearch:7.9.2\n     */\n    public ElasticsearchContainer(String dockerImageName) {\n        this(DockerImageName.parse(dockerImageName));\n    }\n\n    /**\n     * Create an Elasticsearch Container by passing the full docker image name\n     *\n     * @param dockerImageName Full docker image name as a {@link DockerImageName}, like: DockerImageName.parse(\"docker.elastic.co/elasticsearch/elasticsearch:7.9.2\")\n     */\n    public ElasticsearchContainer(final DockerImageName dockerImageName) {\n        super(dockerImageName);\n        dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME, DEFAULT_OSS_IMAGE_NAME, ELASTICSEARCH_IMAGE_NAME);\n\n        if (dockerImageName.isCompatibleWith(DEFAULT_OSS_IMAGE_NAME)) {\n            this.isOss = true;\n            log.warn(\n                \"{} is not supported anymore after 7.10.2. Please switch to {}\",\n                dockerImageName.getUnversionedPart(),\n                DEFAULT_IMAGE_NAME.getUnversionedPart()\n            );\n        }\n\n        withEnv(\"discovery.type\", \"single-node\");\n        // disable disk threshold checks\n        withEnv(\"cluster.routing.allocation.disk.threshold_enabled\", \"false\");\n        // Sets default memory of elasticsearch instance to 2GB\n        // Spaces are deliberate to allow user to define additional jvm options as elasticsearch resolves option files lexicographically\n        withClasspathResourceMapping(\n            \"elasticsearch-default-memory-vm.options\",\n            \"/usr/share/elasticsearch/config/jvm.options.d/ elasticsearch-default-memory-vm.options\",\n            BindMode.READ_ONLY\n        );\n        addExposedPorts(ELASTICSEARCH_DEFAULT_PORT, ELASTICSEARCH_DEFAULT_TCP_PORT);\n        String versionPart = dockerImageName.getVersionPart();","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/elasticsearch/src/main/java/org/testcontainers/elasticsearch/ElasticsearchContainer.java#L86-L122","documentation":"ElasticsearchContainer's constructor warns when the supplied image is compatible with docker.elastic.co/elasticsearch/elasticsearch-oss. The OSS distribution was discontinued after 7.10.2 (license change), so this image variant is no longer supported and the container warns that users should switch to the standard elasticsearch image. Execution continues with isOss=true which affects security/SSL setup.","triggerScenarios":"Constructing ElasticsearchContainer with an image like docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2 or a derived OSS image; image names matching elasticsearch-oss pass the assertCompatibleWith check and trigger the warning.","commonSituations":"Upgrading Testcontainers while still on an old OSS image from pre-7.11 setups; CI templates pinned to OSS images for licensing reasons; tutorials predating the Elastic license change.","solutions":["Switch the image to docker.elastic.co/elasticsearch/elasticsearch:7.17.x or 8.x","If basic (OSS-equivalent) features suffice, the standard image's free license covers them — update and remove OSS-specific config like xpack.security=false hacks","Pin exactly 7.10.2 only if you cannot migrate yet, understanding it's end-of-life","Consider OpenSearch's Testcontainers module if you need a truly open-source fork"],"exampleFix":"// before\nnew ElasticsearchContainer(\"docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2\");\n// after\nnew ElasticsearchContainer(\"docker.elastic.co/elasticsearch/elasticsearch:7.17.9\");","handlingStrategy":"validation","validationCode":"if (imageName.contains(\"elasticsearch-oss\")) {\n    throw new IllegalArgumentException(\"OSS images unsupported after 7.10.2; use docker.elastic.co/elasticsearch/elasticsearch:<version>\");\n}","typeGuard":null,"tryCatchPattern":"// warning, not an exception — catch nothing; migrate config instead.\n// Guard construction:\nDockerImageName img = DockerImageName.parse(\"docker.elastic.co/elasticsearch/elasticsearch:8.11.0\");\nnew ElasticsearchContainer(img);","preventionTips":["Replace elasticsearch-oss images with the standard elasticsearch distribution","Pin explicit versions (7.17.x or 8.x) rather than latest","Remove xpack.security=false style OSS-era workarounds after migrating","Consider the OpenSearch Testcontainers module if the OSS license is a hard requirement"],"tags":["elasticsearch","deprecation","docker-image","versioning"],"backgroundTag":"deprecated-api-usage","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}