Skip to content

Unify node Dockerfile across architectures#12188

Open
hjiawei wants to merge 1 commit intoprojectcalico:masterfrom
hjiawei:unify-node-dockerfile
Open

Unify node Dockerfile across architectures#12188
hjiawei wants to merge 1 commit intoprojectcalico:masterfrom
hjiawei:unify-node-dockerfile

Conversation

@hjiawei
Copy link
Contributor

@hjiawei hjiawei commented Mar 18, 2026

Replace four arch-specific Dockerfiles (Dockerfile.amd64, Dockerfile.arm64, Dockerfile.ppc64le, Dockerfile.s390x) with a single unified Dockerfile that uses the TARGETARCH build arg from docker buildx.

This brings ppc64le and s390x to parity with amd64/arm64 by switching them from Alpine-based images to the UBI-based multi-stage build (AlmaLinux for runit/iptables-legacy, UBI minimal for runtime, scratch for final image).

Also simplify the ARCHES detection in lib.Makefile by removing the Dockerfile-glob-based discovery logic, since no components use the Dockerfile. naming pattern anymore.

Release note:

TBD

@hjiawei hjiawei requested a review from lucastigera March 18, 2026 22:41
@hjiawei hjiawei requested a review from a team as a code owner March 18, 2026 22:41
Copilot AI review requested due to automatic review settings March 18, 2026 22:41
@marvin-tigera marvin-tigera added this to the Calico v3.32.0 milestone Mar 18, 2026
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Mar 18, 2026
@hjiawei hjiawei added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact and removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Mar 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates Calico node image builds by removing architecture-specific Dockerfiles and switching to a single node/Dockerfile that relies on docker buildx’s TARGETARCH, bringing ppc64le/s390x onto the same UBI-based build flow as amd64/arm64.

Changes:

  • Update node/Makefile to always build from node/Dockerfile instead of Dockerfile.$(ARCH).
  • Update node/Dockerfile to copy arch-specific binaries using TARGETARCH and make minor copy/link loop adjustments.
  • Simplify ARCHES defaulting in lib.Makefile now that Dockerfile.<arch> discovery is no longer used; remove legacy arch-specific node Dockerfiles.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
node/Makefile Switch image deps and build invocation to the unified Dockerfile.
node/Dockerfile Use TARGETARCH for selecting calico-node/mountns binaries; minor refactors to copy/link steps.
node/Dockerfile.arm64 Removed; build logic folded into unified Dockerfile.
node/Dockerfile.ppc64le Removed; build logic folded into unified Dockerfile.
node/Dockerfile.s390x Removed; build logic folded into unified Dockerfile.
lib.Makefile Remove Dockerfile-glob-based arch discovery; set a fixed default ARCHES list.

You can also share your feedback on Copilot code review. Take the survey.


## IMAGE_DEPS lists non-Go files the calico/node image depends on.
IMAGE_DEPS = ./Dockerfile.$(ARCH) $(BUILD_DEPS)
IMAGE_DEPS = ./Dockerfile $(BUILD_DEPS)
@hjiawei hjiawei force-pushed the unify-node-dockerfile branch 2 times, most recently from f88b7db to 152b04b Compare March 18, 2026 23:45
Replace four arch-specific Dockerfiles (Dockerfile.amd64, Dockerfile.arm64,
Dockerfile.ppc64le, Dockerfile.s390x) with a single unified Dockerfile that
uses the TARGETARCH build arg from docker buildx.

This brings ppc64le and s390x to parity with amd64/arm64 by switching them
from Alpine-based images to the UBI-based multi-stage build (AlmaLinux for
runit/iptables-legacy, UBI minimal for runtime, scratch for final image).

Also simplify the ARCHES detection in lib.Makefile by removing the
Dockerfile-glob-based discovery logic, since no components use the
Dockerfile.<arch> naming pattern anymore.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hjiawei hjiawei force-pushed the unify-node-dockerfile branch from 152b04b to 12d1334 Compare March 18, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants