Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues correct mysql testContainer with macbook m1 #4082

Closed
tbtrungit opened this issue May 13, 2021 · 7 comments
Closed

Issues correct mysql testContainer with macbook m1 #4082

tbtrungit opened this issue May 13, 2021 · 7 comments

Comments

@tbtrungit
Copy link

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.

@afuentecruz
Copy link

Hi tbtrungit!

In my case, i was running testcontainers version 1.5.0-rc2, if you upgrade to the lastest version (currently 1.5.3) and override the MySqlContainer params constructor telling him to use mysql:5.7.29 (ie, any version greater than 5.7.22 should work fine) fixed the problem.

Hope it helps!

@arron-shin
Copy link

Any update? or solution? I have the same problem with MySQL v5.7.27.

@pdallas
Copy link

pdallas commented Jul 30, 2021

Has anyone made this work? same issue on my m1 macbook.
@afuentecruz, can u share to us how did u override MySQLContainer params constructor?

@bsideup
Copy link
Member

bsideup commented Jul 30, 2021

Hi @pdallas, could you please try Testcontainers 1.16.0?

@pdallas
Copy link

pdallas commented Jul 30, 2021

Thanks for the fast response. I will do just that and let you know!

@pdallas
Copy link

pdallas commented Jul 30, 2021

@bsideup
It works!! Great!

@bsideup
Copy link
Member

bsideup commented Jul 30, 2021

Thanks for trying! I will close this issue as it seems that it got fixed in #4290 👍

@bsideup bsideup closed this as completed Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants