Merge pull request #10155 from bitsf/upgrade_clair_1.10

[cherry-pick] upgrade clair to v2.1.1
This commit is contained in:
Wang Yan 2019-12-06 11:48:42 +08:00 committed by GitHub
commit 6b84b62f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 9 deletions

View File

@ -99,7 +99,7 @@ PREPARE_VERSION_NAME=versions
REGISTRYVERSION=v2.7.1-patch-2819-2553
NGINXVERSION=$(VERSIONTAG)
NOTARYVERSION=v0.6.1
CLAIRVERSION=v2.1.0
CLAIRVERSION=v2.1.1
MIGRATORVERSION=$(VERSIONTAG)
REDISVERSION=$(VERSIONTAG)
NOTARYMIGRATEVERSION=v3.5.4

View File

@ -231,7 +231,7 @@ define _extract_archive
endef
define _get_binary
$(WGET) --timeout 30 --no-check-certificate $1 -O $2
$(WGET) --timeout 30 --no-check-certificate $1 -O $2 || exit 1
endef
build: _build_prepare _build_db _build_portal _build_core _build_jobservice _build_log _build_nginx _build_registry _build_registryctl _build_notary _build_clair _build_clair_adapter _build_redis _build_migrator _build_chart_server

View File

@ -1,7 +1,7 @@
FROM golang:1.12.12
ADD . /go/src/github.com/coreos/clair/
WORKDIR /go/src/github.com/coreos/clair/
ADD . /go/src/github.com/quay/clair/
WORKDIR /go/src/github.com/quay/clair/
RUN export CLAIR_VERSION=$(git describe --tag --always --dirty) && \
go build -ldflags "-X github.com/coreos/clair/pkg/version.Version=$CLAIR_VERSION" github.com/coreos/clair/cmd/clair
RUN export CLAIR_VERSION=$(git describe --tag --always --dirty) GO111MODULE=on && \
go build -ldflags "-X github.com/quay/clair/pkg/version.Version=$CLAIR_VERSION" ./cmd/clair

View File

@ -20,8 +20,7 @@ cur=$PWD
# the temp folder to store distribution source code...
TEMP=`mktemp -d /$TMPDIR/clair.XXXXXX`
git clone https://github.com/coreos/clair.git $TEMP
cd $TEMP; git checkout $VERSION; cd -
git clone -b $VERSION --single-branch https://github.com/quay/clair.git $TEMP
echo 'build the clair binary bases on the golang:1.12.12'
cp Dockerfile.binary $TEMP
@ -29,7 +28,7 @@ docker build -f $TEMP/Dockerfile.binary -t clair-golang $TEMP
echo 'copy the clair binary to local...'
ID=$(docker create clair-golang)
docker cp $ID:/go/src/github.com/coreos/clair/clair binary
docker cp $ID:/go/src/github.com/quay/clair/clair binary
docker rm -f $ID
docker rmi -f clair-golang