Fork me on GitHub
#clojure
<
2023-11-06
>
Santiago14:11:19

I’m trying to build multi-platform docker images via a github action and I keep getting clojure:temurin-21-alpine: no match for platform in manifest This is the job I’m using to build the images:

- name: Build and push
        uses: docker/build-push-action@v5
        with:
          push: true
          tags: ${{ github.repository }}:${{ github.sha }}
          platforms: linux/amd64,linux/arm64
and my Dockerfile with two stages pulls images:
FROM clojure:temurin-21-alpine AS builder
...
FROM eclipse-temurin:21-jre-alpine AS runner
does anyone have experience/seen an open project doing this?

Santiago15:11:00

at least eclipse-temurin:21-jre-alpine has arm64 images, and the clojure image should have it too IIUC

practicalli-johnny15:11:41

Consider using clojure:temurin-17-alpine as the clojure image tag to build the clojure app. Java 21 images are quite new (about a week or so old?) to there may be use cases that havent had much testing.

FROM clojure:temurin-17-alpine AS builder

FROM eclipse-temurin:17-alpine AS final
The current Dockerfile I use is covered in https://practical.li/engineering-playbook/continuous-integration/docker/clojure-multi-stage-dockerfile/ Suggest raising the issue on the #docker channel specifically, especially if it happens with Java 17 images as well

Santiago15:11:54

I was using that one initially, but eclipse-temurin:17-alpine (the runner stage) doesn’t work with ARM yet (https://github.com/adoptium/containers/issues/158) but 21 is available

practicalli-johnny16:11:33

Perhaps the Debian Linux image, bookworm-slim will work more effectively than Alpine for the ARM hardware. Debian has long supported a wide range of hardware (although I dont have a Mac to test it with)

FROM clojure:tools-deps-bookworm-slim AS builder

practicalli-johnny16:11:59

or

FROM clojure:temurin-21-bookworm-slim

Santiago17:11:20

@U05254DQM switching to debian did it 😄 thanks