Skip to content

Commit

Permalink
Merge pull request #5 from thomasferrandiz/update-v0.6
Browse files Browse the repository at this point in the history
update whereabouts to v0.6
  • Loading branch information
thomasferrandiz authored Jan 9, 2023
2 parents 0b778c2 + dd2fde3 commit a3a6c51
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ platform:
steps:
- name: build
pull: always
image: rancher/hardened-build-base:v1.16.12b7
image: rancher/hardened-build-base:v1.17.13b7
commands:
- make DRONE_TAG=${DRONE_TAG}
volumes:
- name: docker
path: /var/run/docker.sock

- name: publish
image: rancher/hardened-build-base:v1.16.12b7
image: rancher/hardened-build-base:v1.17.13b7
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make DRONE_TAG=${DRONE_TAG} image-push
Expand All @@ -35,7 +35,7 @@ steps:
- tag

- name: scan
image: rancher/hardened-build-base:v1.16.12b7
image: rancher/hardened-build-base:v1.17.13b7
commands:
- make DRONE_TAG=${DRONE_TAG} image-scan
volumes:
Expand Down
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
ARG BCI_IMAGE=registry.suse.com/bci/bci-base:15.3.17.20.12
ARG GO_IMAGE=rancher/hardened-build-base:v1.16.15b7
ARG GO_IMAGE=rancher/hardened-build-base:v1.17.13b7
FROM ${BCI_IMAGE} as bci

FROM ${GO_IMAGE} as builder
ARG ARCH="amd64"
ARG TAG="v0.5.3"
ARG TAG="v0.6"
ARG PKG="github.com/k8snetworkplumbingwg/whereabouts"
ARG SRC="github.com/k8snetworkplumbingwg/whereabouts"
RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG}
WORKDIR $GOPATH/src/${PKG}
RUN git fetch --all --tags --prune
RUN git checkout tags/${TAG} -b ${TAG}
ENV GO_LDFLAGS="-X ${PKG}/version.Version=${TAG}"

ENV GO111MODULE=on
RUN go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -mod vendor -o bin/whereabouts cmd/whereabouts.go
RUN go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -mod vendor -o bin/ip-reconciler cmd/reconciler/ip.go cmd/reconciler/errors.go
RUN GIT_SHA=$(git rev-parse --short HEAD) \
GIT_TREE_STATE=$(test -n "`git status --porcelain --untracked-files=no`" && echo "dirty" || echo "clean") \
&& export GO_LDFLAGS="-X ${PKG}/pkg/version.Version=${TAG} \
-X ${PKG}/pkg/version.GitSHA=${GIT_SHA} \
-X ${PKG}/pkg/version.GitTreeState=${GIT_TREE_STATE}" \
&& go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -mod vendor -o bin/whereabouts cmd/whereabouts.go \
&& go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -mod vendor -o bin/ip-control-loop cmd/controlloop/*.go
RUN go-assert-boring.sh bin/*
RUN install -s bin/* /usr/local/bin
RUN whereabouts --version

FROM bci
COPY --from=builder /usr/local/bin/whereabouts .
COPY --from=builder /usr/local/bin/ip-reconciler .
COPY --from=builder /usr/local/bin/ip-control-loop .
ARG PKG="github.com/k8snetworkplumbingwg/whereabouts"
COPY --from=builder /go/src/${PKG}/script/install-cni.sh .
CMD ["/install-cni.sh"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BUILD_META=-build$(shell date +%Y%m%d)
ORG ?= rancher
PKG ?= github.com/k8snetworkplumbingwg/whereabouts
SRC ?= github.com/k8snetworkplumbingwg/whereabouts
TAG ?= v0.5.3$(BUILD_META)
TAG ?= v0.6$(BUILD_META)

ifneq ($(DRONE_TAG),)
TAG := $(DRONE_TAG)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# image-build-whereabouts
This repository builds a hardened image of the CNI [whereabouts](https://github.com/k8snetworkplumbingwg/whereabouts) for rke2.

## Build

```sh
TAG=v0.5.3 make
make
```

0 comments on commit a3a6c51

Please sign in to comment.