Closed joeflack4 closed 9 months ago
The image is currently only build for x86 - der https://hub.docker.com/r/hapiproject/hapi/tags
PR's for adding other archs as part of the GH action are welcome
Hm, it should build arm64 as well (https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/.github/workflows/build-images.yaml#L15) it's also listed in the os/arch: https://hub.docker.com/layers/hapiproject/hapi/latest/images/sha256-4ce79b31a47b2be211405357ef433d2486aaf3e174fff3969172c5bf4b836400?context=explore
You could try replacing the 'build' part of the docket compose file by instead directly referencing the already build image. Ie instead of build: use image: docker.io/hapiproject/hapi:v5.6.0
@joeflack4 is it still not working for you?
This wasn't an issue on my computer, but that of my colleague's: @Sigfried
@Sigfried: You probably don't have time for this, but if you do, do you want to see if chgl's suggestion works?
Hmm, it looks like all the base images don't have arm64 support.
bitnami/tomcat:
gcr.io/distroless/java17:nonroot:
Ok, based on the linked threads, I worked around the problem using the following in a Dockerfile:
FROM hapiproject/hapi:v6.0.1 as hapi
FROM gcr.io/distroless/java17-debian11:nonroot-$TARGETARCH as default
USER 65532:65532
WORKDIR /app
COPY --chown=nonroot:nonroot --from=hapi /app /app
CMD ["/app/main.war"]
(note: you need to use java17-debian11
and not java17
)
@jkiddo this works fine. What do you think about switching to java17-debian11 for the distroless build? For the debuggable image we could use: java17-debian11:debug, or switch to alpine. Both are supporting arm64.
What do you think?
Im fine with that. That is also what https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/413 is about
This wasn't an issue on my computer, but that of my colleague's: @Sigfried
@Sigfried: You probably don't have time for this, but if you do, do you want to see if chgl's suggestion works?
Apologies for never testing that suggestion. I haven't worked on the project where this issue arose since February. But, if there's now a fix and someone wants me to test it, I can do that.
Description
When using a Macbook using an apple silicon / M1 CPU,
docker-compose up -d --build
fails.Errors
1st error message
After doing
mvn clean install
, when doingdocker-compose up -d --build
, we got:no matching manifest for linux/arm64/v8 in the manifest list entries
2nd error message
After doing what's shown in "Thing's we've tried", we got:
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: docker.io/hapiproject/hapi:base: not found
Things we've tried
We followed the instructions in this stackoverflow: https://stackoverflow.com/questions/69708866/how-to-make-docker-compose-work-on-m1-chip
It was suggested that we add the following to each of the services in the
docker-compose.yml
, so we did:platform: linux/x86_64