{"id":"0259aaf6-13eb-484f-9a9f-65fece15903d","task":"Write an Earthfile that builds a multi-platform container image using Earthly's BUILD command with NATIVEPLATFORM and TARGETPLATFORM, and pushes to a registry with --push","domain":"earthly.dev","steps":["Define a base target in the Earthfile that installs dependencies using the appropriate package manager for the language runtime","Create a 'build' target that uses ARG TARGETPLATFORM and ARG NATIVEPLATFORM to conditionally set cross-compilation environment variables (e.g., GOARCH, GOARM) based on the target platform","Add a 'docker' target that calls FROM DOCKERFILE or builds the image inline, referencing the compiled binary from the 'build' target via COPY +build/<binary> .","Define an 'all-platforms' target that calls BUILD --platform linux/amd64 --platform linux/arm64 +docker to fan out the build across platforms","Run 'earthly --push +all-platforms' to build and push a multi-arch manifest to the registry, and verify the manifest list with 'docker buildx imagetools inspect'"],"gotchas":["Earthly runs each platform target in a separate build context; shared artifacts (binaries, test results) must be explicitly passed between targets using SAVE ARTIFACT and COPY + syntax","QEMU emulation is used for cross-platform builds unless the Earthly runner has native ARM64 hardware; QEMU-based builds are significantly slower and can fail for targets that detect emulation","The --push flag requires the Earthly runner to have write credentials for the registry; running without --push produces the image locally but does not push, which can be confusing in CI where local images are not persisted"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:40:37.260Z"},"url":"https://mcp.waymark.network/r/0259aaf6-13eb-484f-9a9f-65fece15903d"}