-
Hello I am carrying out different machine learning processes. Depending on arm64 or amd64 I use completely different base images, so, one of them uses CUDA and the other doesn't. All steps after the from are the same in different platforms I've been reading carefully this : (https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/) Yes, I can execute both with different scripts with different build-args, create a manifest,amend and so on. But, is there a way to do this straight forward? I've been exploring bakes, but I see the same problem: I can't correlate platform to an argument. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can do this by interpolating FROM --platform=linux/amd64 base1 as build-amd64
FROM --platform=linux/arm64 base2 as build-arm64
FROM build-$BUILDARCH
# the rest of your build You can see an example of this kind of style here: https://github.com/tonistiigi/dockerfile-alpine/blob/main/Dockerfile |
Beta Was this translation helpful? Give feedback.
You can do this by interpolating
BUILDPLATFORM
(or similar args) into the stage name. For example:You can see an example of this kind of style here: https://github.com/tonistiigi/dockerfile-alpine/blob/main/Dockerfile