Dockerfile:1
--------------------
1 | >>> FROM adoptopenjdk/openjdk11:jre-11.0.11_9-alpine
2 | VOLUME /tmp
3 | COPY build/libs/*.jar myapp.jar
--------------------
ERROR: failed to solve: adoptopenjdk/openjdk11:jre-11.0.11_9-alpine: no match for platform in manifest sha256:ed7ea16ca04b09cb381a094dff07c5d5ce5f0ead97540fcfc4b67c054e25e217: not found
Any help on this issue.I am using Mac M1 and docker getting this error while executing docker file.
I am getting this error while executing a script file which is calling the docker file.
FROM adoptopenjdk/openjdk11:jre-11.0.11_9-alpine
VOLUME /tmp
COPY build/libs/*.jar myapp.jar
ENTRYPOINT ["java", "-Xmx800m", "-XX:+UseG1GC", "-jar", "-Dspring.profiles.active=cloud", "/myApp.jar"]
The same script is executing well in windows system
The architecture for the M1 Mac and Windows is diff that's the reason behind the error.
adoptopenjdk/openjdk11:jre-11.0.11_9-alpine: no match for platform in manifest
Above error mean the image that you are trying is not available for playgform Macbook. i guess it is OS/ARCH : linuxamd64
Check for the OS/ARCH : ARM and it will work.
Check here all available ARM options : https://hub.docker.com/r/adoptopenjdk/openjdk11/tags?page=1&name=jre-11
Which is suitable for you Slim, nightly release as per need.
Update :
As Rick mentioned you can use the --platform
and cross-run it, but there could be chances of Compatibility, Performance.
Recommended is to use native images whenever possible for performance and compatibility.
you can build your docker image with buildx if building on Mac creates Multi-platform images.