based on pre compiled binaries i want to create a multiarch docker image. i created these binaries using https://github.com/cross-rs/cross .
i want to do something similar to:
FROM --PLATFORM=$TARGETPLATFORM ubuntu:20.04
ADD BINARY_$TARGETPLATFORM /BINARY
this approach does not work because it seems that $TARGETPLATFORM is not useable in "ADD".
build platform by platform and push all these platforms would be my favourite solution. All examples i found are building and pushing all platforms at the same time - which doesn't work for me, because i need to add the correct binary to every image.
it there a way to build platform by platform?
# seems that this is the buildx way
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v .
# i would like to to this:
cp target/linux/amd64/BINARY BINARY
docker buildx build --platform linux/amd64 .
cp target/linux/arm64/BINARY BINARY
docker buildx build --platform linux/arm64 .
cp target/linux/arm/BINARY BINARY
docker buildx build --platform linux/arm/v .
docker buildx create_manifest_and_push_....
building multiple times and than creating a manifest was the solution for me.