-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multi-platform builds #536
Comments
Hi @LuaxY, I believe this should be possible and should be a feature we add. Thank you for submitting it. |
Experimental support for multi-platform builds is available in If you try this feature out, I'd be very curious about your experience with it - either here or on our Slack. |
Tested on my project, work perfectly, big thanks!! Question about local artifacts, example:
package main
import "fmt"
func main() {
fmt.Println("test")
}
FROM golang:1.15-alpine
RUN apk --update --no-cache add git
WORKDIR /mailtrap
all:
BUILD \
--platform=linux/amd64 \
--platform=linux/arm64 \
--platform=linux/arm/v7 \
--platform=linux/arm/v6 \
+build
build:
COPY main.go main.go
RUN go build -o build/test main.go
SAVE ARTIFACT build/test AS LOCAL build/test This will build binary for each platform but also override the local artifcat
The final binary is the last platform stage to finish the
This is the intended behavior? or there is a way to control the artifact name depending the platform? |
Great! There are four new built-in args available, which you can use for this:
You need to predeclare them before using them:
So in your example, you could have
|
Perfect thank you! |
Is there a way to remerge a build split by platform instead of propagating it through all dependant builds?
Instead, i believe with the current setup, i would need to make build-app-linux-arm64 and build-app-linux-amd64 |
You should have get-dep defined in a single target. You can use builtin args like After that, you can reference |
Yeah, I saw the if proposal, it would definitely solve my issue. Frankly all I need to do to solve my specific issue is to map targetplatform. |
Hi there! Do you plans for the For now it says : earthly --platform=linux/amd64 --platform=linux/arm64 --build-arg DISTRO_NAME=bullseye +build
buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)
Error: multi-platform builds are not yet supported on the command line. You may, however, create a target with the instruction BUILD --plaform ... --platform ... +build An Thank you! |
No plans yet.. wondering what you mean by "dynamically". I believe the Earthfile should have enough flexibility in terms of parameters / |
From a ruby script : The arch list is stored in a YAML file read by Ruby which calls Putting the arch list in |
The issue is not the |
read it as |
Got it - yeah makes sense. We should support that. Mind opening a new issue about it? |
Is it possible to support multi-platform (e.g. amd64, arm64, arm v7) image build with
docker buildx
feature?With docker command, by using compatible builder, we can now provide
--platform
flag to specify target platform.docker [buildx] build --platform linux/amd64,linux/arm64,linux/arm/v7 .
https://docs.docker.com/buildx/working-with-buildx/
The text was updated successfully, but these errors were encountered: