Skip to content

Multi-platform different base images #1928

Answered by jedevc
masip85 asked this question in Q&A
Discussion options

You must be logged in to vote

You can do this by interpolating BUILDPLATFORM (or similar args) into the stage name. For example:

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

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@masip85
Comment options

@crazy-max
Comment options

Answer selected by masip85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants