Missing MySQL Image for Docker on Apple M1

Tried firing SDK up on my Apple M1 this morning but was not suucessful. I experienced the following error:

Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:4.1.1:setup (default-cli) on project standalone-pom: Failed to setup server: Unable to execute mojo: Execution null of goal org.openmrs.maven.plugins:openmrs-sdk-docker-maven-plugin:4.1.1:create-mysql failed: Status 404: No such image: mysql:5.6

Checking around seems like there is no official MySQL 5.6 Image for M1. There are some workaround where you need to define the platform by running this command

platform: linux/x86_64

I am not sure how to add this to our SDK. @ibacher @ssmusoke @jwnasambu

@kmurumba am sorry I have never used docker before and I will be glad to learn from other members.

The SDK only exposes a very limited number of properties, but based on our actual needs, so this will need to be an enhancement and code change to the SDK.

Internally the SDK uses the docker-java library to create and manage Docker images. The MySQL image is setup in this Maven plugin which is invoked by the SDK here.

Probably the thing to do is to modify the create-mysql mojo so that it has a property that stores the platform and have this default to “linux/x86_64” on M1 Macs only (the problem being that other ARM-based OSes probably don’t have Rosetta 2 or an equivalent so running x86_64 code on generic ARM machines is likely a bad idea).

Hi, I am also facing the same error is it resolved?

Machine Specs: Apple M1 Pro, Ventura 13.2.1

If yes, Will you help me to fix the same?

@kmurumba @ibacher @jwnasambu

Not yet… I sketched a solution, but I don’t think it’s ever been implemented.

Is there any alternate way to setup the same in Apple M1 ?

How can I contribute to openmrs then?

If you’re working with recent versions of OpenMRS, you can use the mysql:8 or mariadb:10.2 image in Docker… The SDK won’t set that up for you, but you can set it up and then select option 1 in the list of databases. (Both mysql:8 and recent versions of mariadb should have M1-compatible images).

Thanks for the help @ibacher.

Will you please confirm if I have finished the setup process correctly?

Also, when I ran mvn openmrs-sdk:run -DserverId=your_server2 getting error mentioned below