From 2b378899dff4a8287584f1cf3a6c5573fc49e9db Mon Sep 17 00:00:00 2001 From: Ziming Zhang Date: Wed, 4 Dec 2019 16:32:23 +0800 Subject: [PATCH] upgrade clair to v2.1.1 Change-Id: Idb2ad0470a51666d75895d8c5e68d80a67e05276 Signed-off-by: Ziming Zhang --- Makefile | 2 +- make/photon/Makefile | 2 +- make/photon/clair/Dockerfile.binary | 8 ++++---- make/photon/clair/builder | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index ef440036c..0c6e1721f 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/make/photon/Makefile b/make/photon/Makefile index 593123758..3d1419492 100644 --- a/make/photon/Makefile +++ b/make/photon/Makefile @@ -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 diff --git a/make/photon/clair/Dockerfile.binary b/make/photon/clair/Dockerfile.binary index 640962f47..2a406229a 100644 --- a/make/photon/clair/Dockerfile.binary +++ b/make/photon/clair/Dockerfile.binary @@ -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 diff --git a/make/photon/clair/builder b/make/photon/clair/builder index 818f3c0e6..c8dfeb3c7 100755 --- a/make/photon/clair/builder +++ b/make/photon/clair/builder @@ -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