Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add build for flannel-io/flannel-cni-plugin #2

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ARG ARCH="amd64"
ARG TAG="v0.9.1"
ARG TAG="v1.0.0"
ARG FLANNEL_CNI_TAG="v1.0"
ARG UBI_IMAGE=registry.access.redhat.com/ubi7/ubi-minimal:latest
ARG GO_IMAGE=rancher/hardened-build-base:v1.16.7b7

### Build the cni-plugins ###
FROM ${GO_IMAGE} as cni_plugins
ARG TAG
ARG FLANNEL_CNI_TAG
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 \
Expand All @@ -16,13 +18,23 @@ RUN git clone --depth=1 https://github.com/containernetworking/plugins.git $GOPA
-X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${TAG} \
-linkmode=external -extldflags \"-static -Wl,--fatal-warnings\" \
"

RUN git clone --depth=1 https://github.com/flannel-io/cni-plugin.git $GOPATH/src/github.com/flannel-io/cni-plugin \
&& cd $GOPATH/src/github.com/flannel-io/cni-plugin \
&& git fetch --all --tags --prune \
&& git checkout tags/${FLANNEL_CNI_TAG} -b ${FLANNEL_CNI_TAG} \
&& go mod vendor \
&& make build_linux \
&& install -s dist/flannel-amd64 $GOPATH/src/github.com/containernetworking/plugins/bin/flannel

WORKDIR $GOPATH/src/github.com/containernetworking/plugins
RUN go-assert-static.sh bin/* \
&& go-assert-boring.sh \
bin/bandwidth \
bin/bridge \
bin/dhcp \
bin/firewall \
bin/flannel \
bin/host-device \
bin/host-local \
bin/ipvlan \
Expand Down