Arm64 Docker image?

Hi,

In the times of the Apple Silicon chip, wouldn’t it make sense to provide an arm64 image for the Axon Server? I built one myself, but it would be convenient to just have one ready on Docker Hub.

Thanks,
Markus

5 Likes

I agree. That would be great!

Hey Markus,
great idea! We will need to look at a good base for this because there are no distroless Java images for arm64 yet. I see Google has “gcr.io/distroless/base:latest-arm64”, as well as “nonroot-arm64” and “debug-arm64” and “debug-nonroot-arm64”, so we would have to reproduce their Java installation and test if that works. That is going to be a bit of a thing because Apple does not provide VM images to run on non-Apple hardware. Finding a generic ARM VM in the cloud shouldn’t be a problem though. Do you have any experience showing that that is a valid test for running on Apple hardware?

Cheers,
Bert

Hey,

I didn’t run comprehensive tests with my image - just checked if my application would work as expected.

The base image I used is: bellsoft/liberica-openjdk-debian:15

If you provide an image, I can do some tests here on my notebook.

Thanks,
Markus

Has there been any movement on this? I would also be able to test the image on my notebook. At this point running Axon Server is not possible on an M1 MacBook.

Jonathan,
We’ve been looking at the Google situation, but it looks like there’s no real movement on the multi-platform part towards the language-specific builds. I’ve also looked at RedHat’s ubi8 builds because they appear to be well maintained and frequently updated with security patches. The downside is that they are significantly larger than the Distroless images, but for a Docker deployment on developer laptops, having a complete environment with shell and tools might actually be an advantage.

I’ll let you know when we have a build ready.

Cheers,
Bert

1 Like

Would it be possible to provide some sort of documentation on how to set up your own arm64 Axon Server Docker image similar to this GitHub - AxonIQ/running-axon-server: The files that go with the "Running Axon Server" Blog series.? This way the community could test the image and add to it.

Jonathan,
the current image is built using the Jib Maven plugin, by running the Axon Server SE build with “-Pdocker”. This uses the “gcr.io/distroless/java:11” as its base and creates an “exploded JAR” installation in the root. The OpenJDK image for Java 11 (“openjdk:11”) is supposed to support the arm architecture. Can you verify that with e.g. a “docker run --rm -it openjdk:11 java -version”?

Bert

Hi Bert, I was able to run the command and pull the jdk version. When trying to build my own image using this Dockerfile running-axon-server/Dockerfile at 065a1729a4dd9830ac44ce6b8f58ff52b1c79d31 · AxonIQ/running-axon-server · GitHub I am getting some odd errors related to Spring, I’m not sure how to resolve those. By the way, AWS EC2 also supports arm64 AWS Graviton - Amazon Web Services, that should allow you to test the image.

Not having seen your Dockerfile or logs, I would hazard to guess that you ran Axon Server under user “axonserver”, and the errors are concerning rights on the volumes.

1 Like

Hi all, is there any progress on a new image? A month later I find this thread, trying to solve the same problem. Running on M1 with Rosetta 2 installed, I get the same error others have reported:

docker run --rm --name axonserver --platform linux/amd64 -p 8024:8024 -p 8124:8124 axoniq/axonserver
Unable to find image ‘axoniq/axonserver:latest’ locally
latest: Pulling from axoniq/axonserver

Digest: sha256:ecef7e434219c584fb56352d052dc8074401ed66ec41c711ec854ec0499e6bab
Status: Downloaded newer image for axoniq/axonserver:latest
_ ____
/ \ __ _____ _ __ / | ___ _ ____ _____ _ __
/ _ \ \ / / _ | ’
\
_ \ / _ \ '\ \ / / _ \ '|
/ ___ \ > < () | | | |) | __/ | \ V / __/ |
/
/ _/
/__/|| ||____/ _|| _/ ___||
Standard Edition Powered by AxonIQ

version: 4.5.6
2021-08-24 14:41:26.087 INFO 1 — [ main] io.axoniq.axonserver.AxonServer : Starting AxonServer using Java 11.0.12 on 81c80db0ed41 with PID 1 (/app/classes started by root in /)
2021-08-24 14:41:26.098 INFO 1 — [ main] io.axoniq.axonserver.AxonServer : No active profile set, falling back to default profiles: default
2021-08-24 14:41:30.011 WARN 1 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [io.axoniq.axonserver.AxonServer]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] cannot be opened because it does not exist
2021-08-24 14:41:30.123 ERROR 1 — [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [io.axoniq.axonserver.AxonServer]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) ~[spring-context-5.3.3.jar:5.3.3]

Hi all there, is any news about axon image for Mac m1 architecture ? Now I have the same error as Assen Kolov have.

docker run --rm --name axonserver --platform linux/amd64 -p 8024:8024 -p 8124:8124 axoniq/axonserver
_ ____
/ \ __ _____ _ __ / | ___ _ ____ _____ _ __
/ _ \ \ / / _ | ’
\
_ \ / _ \ '\ \ / / _ \ '|
/ ___ \ > < () | | | |) | __/ | \ V / __/ |
/
/ _/
/__/|| ||____/ _|| _/ ___||
Standard Edition Powered by AxonIQ

version: 4.5.6
2021-09-13 12:39:26.020 INFO 1 — [ main] io.axoniq.axonserver.AxonServer : Starting AxonServer using Java 11.0.12 on 396064f9ca7e with PID 1 (/app/classes started by root in /)
2021-09-13 12:39:26.031 INFO 1 — [ main] io.axoniq.axonserver.AxonServer : No active profile set, falling back to default profiles: default
2021-09-13 12:39:30.001 WARN 1 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [io.axoniq.axonserver.AxonServer]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] cannot be opened because it does not exist
2021-09-13 12:39:30.105 ERROR 1 — [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [io.axoniq.axonserver.AxonServer]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:336) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:252) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:285) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:99) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:751) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:569) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.4.2.jar:2.4.2]
at io.axoniq.axonserver.AxonServer.main(AxonServer.java:55) ~[classes/:na]
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[spring-core-5.3.3.jar:5.3.3]
at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55) ~[spring-core-5.3.3.jar:5.3.3]
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:49) ~[spring-core-5.3.3.jar:5.3.3]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-5.3.3.jar:5.3.3]
at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73) ~[spring-boot-2.4.2.jar:2.4.2]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[spring-core-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:696) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getRelated(ConfigurationClassParser.java:1090) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getAnnotationAttributes(ConfigurationClassParser.java:1071) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.collectImports(ConfigurationClassParser.java:549) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:522) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:311) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) ~[spring-context-5.3.3.jar:5.3.3]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) ~[spring-context-5.3.3.jar:5.3.3]
… 14 common frames omitted