Skip to content

Commit

Permalink
Merge pull request #8 from manuelbuil/simplify
Browse files Browse the repository at this point in the history
Simplify the multus image
  • Loading branch information
manuelbuil authored Apr 16, 2021
2 parents e9ef557 + a8d6651 commit 1a609dd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
25 changes: 0 additions & 25 deletions 0001-Add-all-important-multus-binaries.patch

This file was deleted.

30 changes: 0 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 1a609dd

Please sign in to comment.