Skip to content

Commit

Permalink
Add Dockerfiles for arm64 and ppc64le
Browse files Browse the repository at this point in the history
Signed-off-by: amaslennikov <[email protected]>
  • Loading branch information
almaslennikov committed Jul 11, 2023
1 parent a3d9f1f commit 11e5463
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
on:
push:
branches:
- master
- main
jobs:
build-and-push-amd64-multi-networkpolicy-tc:
name: image push amd64
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -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"]
34 changes: 34 additions & 0 deletions Dockerfile.ppc64le
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 11e5463

Please sign in to comment.