Skip to content

Fix Docker multi-arch build by using buildx directly#1935

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-docker-push-release-build
Open

Fix Docker multi-arch build by using buildx directly#1935
Copilot wants to merge 3 commits intomainfrom
copilot/fix-docker-push-release-build

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Docker push was failing with "defangio/defang-cli:amd64-v3.2.0 is a manifest list" when attempting docker manifest create. When buildx is enabled, docker build --platform creates manifest lists, not single-platform images.

Changes

Replaced the multi-step build process with a single buildx command:

Before:

image-amd64:
	docker build --platform linux/amd64 -t $(DOCKER_IMAGE_AMD64) .

image-arm64:
	docker build --platform linux/arm64 -t $(DOCKER_IMAGE_ARM64) .

push-images: images login
	docker push $(DOCKER_IMAGE_AMD64)
	docker push $(DOCKER_IMAGE_ARM64)
	docker manifest create --amend $(DOCKER_IMAGE_NAME):$(VERSION) \
	  $(DOCKER_IMAGE_AMD64) $(DOCKER_IMAGE_ARM64)
	docker manifest push $(DOCKER_IMAGE_NAME):$(VERSION)

After:

push-images: login
	docker buildx build \
	  --platform linux/amd64,linux/arm64 \
	  --push \
	  -t $(DOCKER_IMAGE_NAME):$(VERSION) \
	  -t $(DOCKER_IMAGE_NAME):latest \
	  --build-arg VERSION=$(VERSION) \
	  --build-arg GO_VERSION=$(GO_VERSION) \
	  .

The buildx command handles multi-arch manifest creation automatically when pushing.

Original prompt

This section details on the original issue you should resolve

<issue_title>Docker push release build fails</issue_title>
<issue_description>https://github.com/DefangLabs/defang/actions/runs/21957743944/job/63465390964

arm64-v3.2.0: digest: sha256:814698d1eee7bb87822f95c5d8f8b413741be9d17fbaac27420b76857b61e10c size: 856
docker manifest create --amend \
  defangio/defang-cli:v3.2.0 \
  defangio/defang-cli:amd64-v3.2.0 \
  defangio/defang-cli:arm64-v3.2.0
docker.io/defangio/defang-cli:amd64-v3.2.0 is a manifest list
make: *** [Makefile:226: push-images] Error 1

Our Railpack workflow does a pretty good job of building arm64+amd64 images so we should see if we can copy that. </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 18, 2026 18:18
Replace separate docker build commands with docker buildx build that
properly handles multi-platform builds. This fixes the "is a manifest
list" error that occurred when trying to create manifests from images
built with docker build --platform.

The new approach uses docker buildx build with --platform
linux/amd64,linux/arm64 to build both architectures in one command
and pushes them directly with the --push flag.

Co-authored-by: jordanstephens <706922+jordanstephens@users.noreply.github.com>
Co-authored-by: jordanstephens <706922+jordanstephens@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Docker push release build failure Fix Docker multi-arch build by using buildx directly Feb 18, 2026
Copilot AI requested a review from jordanstephens February 18, 2026 18:20
Copy link
Member

@lionello lionello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, use https://github.com/docker/setup-buildx-action (it uses containerd driver for multi-platform builds by default)

@jordanstephens
Copy link
Member

No, use docker/setup-buildx-action (it uses containerd driver for multi-platform builds by default)

@copilot

Copy link
Contributor Author

Copilot AI commented Feb 18, 2026

No, use docker/setup-buildx-action (it uses containerd driver for multi-platform builds by default)

@copilot

The current implementation already relies on docker/setup-buildx-action (configured on line 391 of the workflow). The docker buildx build command uses the containerd driver from setup-buildx-action for multi-platform builds. No changes needed.

@lionello lionello marked this pull request as ready for review February 18, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker push release build fails

3 participants

Comments