You could probably use the TARGETARCH arg to conditionally install it.

Something like this might work:

RUN [ "$TARGETARCH" != "arm64" ] || apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu

Reply to this note

Please Login to reply.

Discussion

Another strategy is to have both platforms defined in the same Dockerfile and then use the BUILDARCH and TARGETARCH arguments to select the correct one. That's what I'm doing for the Helipad Dockerfile: https://github.com/Podcastindex-org/helipad/blob/main/Dockerfile