Docker builds are failing with buildx because of the --load flag which is incompatible with multi-platform builds.
Error
docker build failed: failed to build ghcr.io/bsubio/cli:v0.15.0-arm64:
exit status 125: unknown flag: --load
Root Cause
When building multi-platform images with buildx, the --load flag cannot be used. Multi-platform builds must be pushed directly to a registry, they cannot be loaded into the local Docker daemon.
From Docker docs:
The --load flag is not supported with multi-platform builds. To use multi-platform builds, you must push images to a registry.
Current Configuration
We're using:
dockers:
- use: buildx
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64"
Solution
For multi-platform buildx builds, we should NOT load images locally. They should be pushed directly. GoReleaser may be automatically adding --load which conflicts with buildx multi-platform mode.
Options:
- Don't use buildx (go back to regular docker build for single platform)
- Use buildx but ensure images are pushed, not loaded
- Build each architecture separately without buildx, then create manifests
Docker builds are failing with buildx because of the
--loadflag which is incompatible with multi-platform builds.Error
Root Cause
When building multi-platform images with buildx, the
--loadflag cannot be used. Multi-platform builds must be pushed directly to a registry, they cannot be loaded into the local Docker daemon.From Docker docs:
Current Configuration
We're using:
Solution
For multi-platform buildx builds, we should NOT load images locally. They should be pushed directly. GoReleaser may be automatically adding
--loadwhich conflicts with buildx multi-platform mode.Options: