From a8d6651d5732b0f3dbab1b0a9e713ee5e454b1b3 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Fri, 16 Apr 2021 09:33:33 +0200 Subject: [PATCH] Simplify the multus image Now that we have the cni-plugins image, we don't need to include the cnis in this image Signed-off-by: Manuel Buil --- 0001-Add-all-important-multus-binaries.patch | 25 ---------------- Dockerfile | 30 -------------------- 2 files changed, 55 deletions(-) delete mode 100644 0001-Add-all-important-multus-binaries.patch diff --git a/0001-Add-all-important-multus-binaries.patch b/0001-Add-all-important-multus-binaries.patch deleted file mode 100644 index eee3d83..0000000 --- a/0001-Add-all-important-multus-binaries.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fc5241fa9c9b3025e27b93ccbb3a6d8e6fd9160e Mon Sep 17 00:00:00 2001 -From: Manuel Buil -Date: Fri, 9 Apr 2021 17:03:29 +0200 -Subject: [PATCH] Add all important multus binaries - -Signed-off-by: Manuel Buil ---- - images/entrypoint.sh | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/images/entrypoint.sh b/images/entrypoint.sh -index de88edce..5549058b 100755 ---- a/images/entrypoint.sh -+++ b/images/entrypoint.sh -@@ -177,6 +177,7 @@ done - if [ "$SKIP_BINARY_COPY" = false ]; then - cp -f $MULTUS_BIN_FILE $CNI_BIN_DIR/_multus - mv -f $CNI_BIN_DIR/_multus $CNI_BIN_DIR/multus -+ mv -f /opt/cni/bin/* $CNI_BIN_DIR/ - else - log "Entrypoint skipped copying Multus binary." - fi --- -2.26.2 - diff --git a/Dockerfile b/Dockerfile index 95002a0..a613d49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,46 +12,16 @@ ARG ARCH ARG TAG ENV GOARCH ${ARCH} ENV GOOS "linux" -COPY 0001-Add-all-important-multus-binaries.patch . RUN git clone --depth=1 https://github.com/k8snetworkplumbingwg/multus-cni \ && cd multus-cni \ && git fetch --all --tags --prune \ && git checkout tags/${TAG} -b ${TAG} \ - && patch -p1 < ../0001-Add-all-important-multus-binaries.patch \ && ./hack/build-go.sh -### Build the CNI plugins ### -FROM ${GO_IMAGE} as cni_plugins -ARG TAG -ARG CNI_PLUGINS_VERSION="v0.9.1" -RUN git clone --depth=1 https://github.com/containernetworking/plugins.git $GOPATH/src/github.com/containernetworking/plugins \ - && cd $GOPATH/src/github.com/containernetworking/plugins \ - && git fetch --all --tags --prune \ - && git checkout tags/${CNI_PLUGINS_VERSION} -b ${CNI_PLUGINS_VERSION} \ - && sh -ex ./build_linux.sh -v \ - -gcflags=-trimpath=/go/src \ - -ldflags " \ - -X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${CNI_PLUGINS_VERSION} \ - -linkmode=external -extldflags \"-static -Wl,--fatal-warnings\" \ - " -WORKDIR $GOPATH/src/github.com/containernetworking/plugins -RUN go-assert-static.sh bin/* \ - && go-assert-boring.sh \ - bin/bridge \ - bin/dhcp \ - bin/host-device \ - bin/host-local \ - bin/ipvlan \ - bin/macvlan \ - bin/ptp \ - && mkdir -vp /opt/cni/bin \ - && install -D -s bin/* /opt/cni/bin - # Create the multus image FROM ${UBI_IMAGE} RUN microdnf update -y && microdnf install python COPY --from=builder /go/multus-cni /usr/src/multus-cni -COPY --from=cni_plugins /opt/cni/bin/bridge /opt/cni/bin/dhcp /opt/cni/bin/host-device /opt/cni/bin/host-local /opt/cni/bin/ipvlan /opt/cni/bin/macvlan /opt/cni/bin/ptp /opt/cni/bin/static /opt/cni/bin/tuning /opt/cni/bin/ WORKDIR / RUN cp /usr/src/multus-cni/images/entrypoint.sh /entrypoint.sh ENTRYPOINT ["entrypoint.sh"]