Skip to content

Feat/mysql oracle image compatibility#11767

Closed
haider2122 wants to merge 1 commit intotestcontainers:mainfrom
haider2122:feat/mysql-oracle-image-compatibility
Closed

Feat/mysql oracle image compatibility#11767
haider2122 wants to merge 1 commit intotestcontainers:mainfrom
haider2122:feat/mysql-oracle-image-compatibility

Conversation

@haider2122
Copy link
Copy Markdown
Contributor

What

Adds container-registry.oracle.com/mysql/community-server as a natively
compatible image name in MySQLContainer.

Why

Per MySQL's official documentation,
container-registry.oracle.com/mysql/community-server is the official
Docker image of MySQL. The docker.io/mysql image is not officially maintained by Oracle.

Previously, users who wanted to use the official image had to use a workaround:

DockerImageName.parse("container-registry.oracle.com/mysql/community-server:8.0")
    .asCompatibleSubstituteFor("mysql")

This change makes that unnecessary:

new MySQLContainer(DockerImageName.parse(
    "container-registry.oracle.com/mysql/community-server:8.0"))

Changes

  • Added ORACLE_IMAGE_NAME constant to org.testcontainers.mysql.MySQLContainer
  • Added ORACLE_IMAGE_NAME constant to deprecated org.testcontainers.containers.MySQLContainer
  • Updated assertCompatibleWith in both classes to accept the Oracle image
  • Added test verifying Oracle image name is accepted without throwing

Closes #9452

@haider2122 haider2122 requested a review from a team as a code owner May 2, 2026 11:27
…rver image

MySQLContainer now natively accepts the official Oracle MySQL image
without requiring .asCompatibleSubstituteFor(mysql).
According to MySQL documentation, container-registry.oracle.com/mysql/community-server
is the official Docker image of MySQL, not the docker.io/mysql image.
Closes testcontainers#9452
@eddumelendez
Copy link
Copy Markdown
Member

I don't think we can add container-registry.oracle.com/mysql/community-server as compatible image if test are failing (testWithOnlyUserReadableCustomIniFile, testMySQLWithCustomIniFile). This due to a different path for configuration. Also, the purpose of DockerImageName.parse("container-registry.oracle.com/mysql/community-server:8").asCompatibleSubstituteFor("mysql") is adding images that developers think are compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Set compatibility for container-registry.oracle.com/mysql/community-server for MySQL module

2 participants