Skip to content

Commit 8386ca8

Browse files
ci: fix multiplatform docker buildx builder
1 parent c19830f commit 8386ca8

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

{{cookiecutter.project_slug}}/taskfiles/docker.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,20 @@ tasks:
150150
Build using docker buildx bake with the specified target.
151151
152152
AVAILABLE TARGETS
153-
- build (default): Builds the main image
154-
- amd64: Builds specifically for AMD64 platform
155-
- arm64: Builds specifically for ARM64 platform
156-
- multi-platform: Builds for both AMD64 and ARM64 platforms
153+
- build (default): Builds the main image and loads to Docker
154+
- amd64: Builds specifically for AMD64 platform and loads to Docker
155+
- arm64: Builds specifically for ARM64 platform and loads to Docker
156+
- multi-platform: Builds for both AMD64 and ARM64 platforms (cached only, not loaded)
157157
158158
USAGE
159159
task docker:buildx
160160
task docker:buildx -- amd64
161161
task docker:buildx -- arm64
162162
task docker:buildx -- multi-platform
163+
164+
NOTES
165+
- Single-platform builds (build, amd64, arm64) are loaded into local Docker
166+
- Multi-platform builds are cached but not loaded (use docker:push to publish)
163167
deps:
164168
- validate
165169
- create-builder
@@ -180,7 +184,15 @@ tasks:
180184
esac
181185
fi
182186
183-
docker buildx bake \
184-
--file docker-bake.hcl \
185-
$TARGET \
186-
--load
187+
# Multi-platform builds cannot be loaded into Docker
188+
# They must be pushed to a registry or kept in cache
189+
if [ "$TARGET" = "multi-platform" ]; then
190+
docker buildx bake \
191+
--file docker-bake.hcl \
192+
$TARGET
193+
else
194+
docker buildx bake \
195+
--file docker-bake.hcl \
196+
$TARGET \
197+
--load
198+
fi

0 commit comments

Comments
 (0)