diff --git a/.github/workflows/image-push-master.yaml b/.github/workflows/image-push-main.yaml similarity index 99% rename from .github/workflows/image-push-master.yaml rename to .github/workflows/image-push-main.yaml index 94ca378..b0be626 100644 --- a/.github/workflows/image-push-master.yaml +++ b/.github/workflows/image-push-main.yaml @@ -6,7 +6,7 @@ env: on: push: branches: - - master + - main jobs: build-and-push-amd64-multi-networkpolicy-tc: name: image push amd64 diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 new file mode 100644 index 0000000..b73f093 --- /dev/null +++ b/Dockerfile.arm64 @@ -0,0 +1,34 @@ +# Build go project +FROM arm64v8/golang:1.20-alpine as go-build + +# Add everything +COPY . /usr/src/multi-networkpolicy-tc + +WORKDIR /usr/src/multi-networkpolicy-tc +RUN go build ./cmd/multi-networkpolicy-tc/ + +# Build iproute2 +FROM quay.io/centos/centos:stream8 as iproute-build + +ARG IPROUTE2_TAG=v5.17.0 + +RUN dnf -q -y groupinstall "Development Tools" && dnf -q -y install git libmnl-devel-1.0.4-6.el8 && dnf clean all + +RUN git clone --branch ${IPROUTE2_TAG} https://github.com/shemminger/iproute2.git + +WORKDIR /iproute2 +RUN make && make install + + +# collect everything into target container +# TODO(adrianc): once we switch to native netlink to drive TC we can switch back to distroless +#FROM gcr.io/distroless/base +FROM quay.io/centos/centos:stream8 +LABEL io.k8s.display-name="Multus NetworkPolicy TC" \ + io.k8s.description="This is a component provides NetworkPolicy objects for secondary interfaces created with Multus CNI" +RUN dnf -q -y install git libmnl-1.0.4-6.el8 && dnf clean all +COPY --from=go-build /usr/src/multi-networkpolicy-tc/multi-networkpolicy-tc /usr/bin +COPY --from=iproute-build /sbin/tc /sbin +WORKDIR /usr/bin + +ENTRYPOINT ["multi-networkpolicy-tc"] diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le new file mode 100644 index 0000000..468fa7f --- /dev/null +++ b/Dockerfile.ppc64le @@ -0,0 +1,34 @@ +# Build go project +FROM ppc64le/golang:1.20-alpine as go-build + +# Add everything +COPY . /usr/src/multi-networkpolicy-tc + +WORKDIR /usr/src/multi-networkpolicy-tc +RUN go build ./cmd/multi-networkpolicy-tc/ + +# Build iproute2 +FROM quay.io/centos/centos:stream8 as iproute-build + +ARG IPROUTE2_TAG=v5.17.0 + +RUN dnf -q -y groupinstall "Development Tools" && dnf -q -y install git libmnl-devel-1.0.4-6.el8 && dnf clean all + +RUN git clone --branch ${IPROUTE2_TAG} https://github.com/shemminger/iproute2.git + +WORKDIR /iproute2 +RUN make && make install + + +# collect everything into target container +# TODO(adrianc): once we switch to native netlink to drive TC we can switch back to distroless +#FROM gcr.io/distroless/base +FROM quay.io/centos/centos:stream8 +LABEL io.k8s.display-name="Multus NetworkPolicy TC" \ + io.k8s.description="This is a component provides NetworkPolicy objects for secondary interfaces created with Multus CNI" +RUN dnf -q -y install git libmnl-1.0.4-6.el8 && dnf clean all +COPY --from=go-build /usr/src/multi-networkpolicy-tc/multi-networkpolicy-tc /usr/bin +COPY --from=iproute-build /sbin/tc /sbin +WORKDIR /usr/bin + +ENTRYPOINT ["multi-networkpolicy-tc"]