Skip to content

Issues correct mysql testContainer with macbook m1 #4082

@tbtrungit

Description

@tbtrungit

Hi all. I using macbook m1. Now i using testContainer test repository with mysql. But i have a problem. Testcontainer cannot pull correct images mysql because docker in macbook m1 cannot use manifest for linux/arm64/v8

My config:

open class MySqlResourceTest : QuarkusTestResourceLifecycleManager {
    private val DATABASE: SpecifiedMySQLContainer = SpecifiedMySQLContainer("mysql:5.7.8").apply {
        withDatabaseName("test")
        withUsername("abc")
        withPassword("123456")
        withExposedPorts(3317)
    }

    override fun start(): MutableMap<String, String> {
        DATABASE.start()
        DATABASE.setCommand()
        return Collections.singletonMap("quarkus.datasource.url", DATABASE.jdbcUrl)
    }

    override fun stop() {
        DATABASE.stop()
    }
}

When i try pull it throws me exception

Could not pull image: no matching manifest for linux/arm64/v8 in the manifest list entries

If i using docker-compose , i using command : platform: linux/x86_64 then it work. But on testContainer i cannot find anything config how to change platform or config looklike : platform: linux/x86_64 in testContainer. How to pull mysql in testContainer correct platform : platform: linux/x86_64 . I don't want change to mariaDb because my project config mysql. How to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions