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
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).
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).