chore(clair): bump up clair adapter version to 1.0.2

Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
He Weiwei 2020-04-15 14:04:22 +00:00
parent 5a0373e7cc
commit 355c16943c
3 changed files with 8 additions and 4 deletions

View File

@ -102,7 +102,7 @@ REGISTRYVERSION=v2.7.1-patch-2819-2553
NOTARYVERSION=v0.6.1
CLAIRVERSION=v2.1.1
NOTARYMIGRATEVERSION=v3.5.4
CLAIRADAPTERVERSION=v1.0.1
CLAIRADAPTERVERSION=v1.0.2
TRIVYVERSION=v0.5.4
TRIVYADAPTERVERSION=v0.8.0

View File

@ -1,7 +1,11 @@
FROM golang:1.13.8
ARG VERSION
ARG COMMIT
ADD . /go/src/github.com/goharbor/harbor-scanner-clair/
WORKDIR /go/src/github.com/goharbor/harbor-scanner-clair/
RUN export GOFLAGS=-mod=vendor GOOS=linux GO111MODULE=on CGO_ENABLED=0 && \
go build -o harbor-scanner-clair cmd/harbor-scanner-clair/main.go
go build -ldflags "-X main.version=$VERSION -X main.commit=$COMMIT -X main.date=`date -u --iso-8601=seconds`" \
-o harbor-scanner-clair cmd/harbor-scanner-clair/main.go

View File

@ -21,11 +21,11 @@ cur=$PWD
# The temporary directory to clone Clair adapter source code
TEMP=$(mktemp -d ${TMPDIR-/tmp}/clair-adapter.XXXXXX)
git clone https://github.com/goharbor/harbor-scanner-clair.git $TEMP
cd $TEMP; git checkout $VERSION; cd -
cd $TEMP; git checkout $VERSION; export COMMIT=$(git rev-list -1 HEAD); cd -
echo "Building Clair adapter binary based on golang:1.13.8..."
cp Dockerfile.binary $TEMP
docker build -f $TEMP/Dockerfile.binary -t clair-adapter-golang $TEMP
docker build --build-arg VERSION=${VERSION} --build-arg COMMIT=${COMMIT} -f $TEMP/Dockerfile.binary -t clair-adapter-golang $TEMP
echo "Copying Clair adapter binary from the container to the local directory..."
ID=$(docker create clair-adapter-golang)