diff --git a/Dockerfile b/Dockerfile index 996c07e..f05419c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,12 +26,7 @@ RUN set -x && \ ARG TARGETPLATFORM # setup required packages for cross-compilation RUN set -x && \ - xx-apk --no-cache add musl-dev gcc linux-headers \ - zstd-static \ - zlib-static \ - libbpf-dev \ - libpcap-dev \ - libelf-static + xx-apk --no-cache add musl-dev gcc FROM base-builder as builder ARG TAG=v3.27.3 @@ -50,15 +45,13 @@ RUN mkdir -p /opt/xtables/ &&\ RUN tar xvf /opt/xtables/k3s-root-xtables.tar -C /opt/xtables ### END K3S XTABLES ##### -#TDO check arch to use here -FROM calico/bird:v0.3.3-184-g202a2186-${BUILDARCH} AS calico_bird +FROM calico/bird:v0.3.3-184-g202a2186-${TARGETARCH} AS calico_bird ### BEGIN CALICOCTL ### FROM builder AS calico_ctl ARG TAG=v3.27.3 ARG GOEXPERIMENT WORKDIR $GOPATH/src/github.com/projectcalico/calico/calicoctl -ARG TARGETPLATFORM ARG TARGETARCH RUN xx-go --wrap &&\ GO_LDFLAGS="-linkmode=external \ @@ -81,7 +74,6 @@ COPY dualStack-changes.patch . # Apply the patch only in versions v3.20 and v3.21. It is already part of v3.22 RUN if [[ "${TAG}" =~ "v3.20" || "${TAG}" =~ "v3.21" ]]; then patch -p1 < dualStack-changes.patch; fi ENV GO_LDFLAGS="-linkmode=external -X main.VERSION=${TAG}" -ARG TARGETPLATFORM ARG TARGETARCH RUN xx-go --wrap RUN go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -o bin/calico ./cmd/calico @@ -121,7 +113,6 @@ WORKDIR $GOPATH/src/github.com/projectcalico/calico RUN git fetch --all --tags --prune RUN git checkout tags/${TAG} -b ${TAG} -### BEGIN CALICO NODE ### ### Can't use go-build-static.sh due to -Wl and --fatal-warnings flags ### FROM nodebuilder AS calico_node ARG ARCH @@ -225,7 +216,7 @@ FROM scratch AS calico_rootfs_overlay_arm64 COPY --from=calico_node /go/src/github.com/projectcalico/calico/node/filesystem/etc/ /etc/ COPY --from=calico_node /go/src/github.com/projectcalico/calico/node/filesystem/licenses/ /licenses/ COPY --from=calico_node /go/src/github.com/projectcalico/calico/node/filesystem/sbin/ /usr/sbin/ -COPY --from=calico_node /strip/bin /usr/bin/ +COPY --from=strip_binary /strip/bin /usr/bin/ COPY --from=strip_binary /strip/flexvol/bin/flexvoldriver /usr/local/bin/flexvoldriver COPY --from=calico_pod2daemon /usr/local/bin/ /usr/local/bin/ COPY --from=calico/bpftool:v5.3-arm64 /bpftool /usr/sbin/ @@ -260,4 +251,4 @@ COPY --from=calico_rootfs_overlay / / ENV PATH=$PATH:/opt/cni/bin RUN set -x && \ test -e /opt/cni/bin/install && \ - ln -vs /opt/cni/bin/install /install-cni \ + ln -vs /opt/cni/bin/install /install-cni diff --git a/Makefile b/Makefile index 091cff8..bd67b3b 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ K3S_ROOT_VERSION ?= v0.13.0 ifeq (,$(filter %$(BUILD_META),$(TAG))) $(error TAG $(TAG) needs to end with build metadata: $(BUILD_META)) endif - +ARCH=arm64 .PHONY: image-build image-build: docker buildx build --no-cache \ @@ -30,7 +30,6 @@ image-build: --tag $(ORG)/hardened-calico:$(TAG) \ --tag $(ORG)/hardened-calico:$(TAG)-$(ARCH) \ --load \ - --progress=plain \ . .PHONY: image-push