mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-20 23:57:42 +01:00
823a9d11e9
The PR to fix the Alpine issue has been merged to Clair's release-2.0 branch, and released v2.0.5. This commit updates Harbor to include that change and re-enable Clair's updaters by default. Signed-off-by: Daniel Jiang <jiangd@vmware.com>
40 lines
807 B
Bash
Executable File
40 lines
807 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set +e
|
|
|
|
if [ -z $1 ]; then
|
|
error "Please set the 'version' variable"
|
|
exit 1
|
|
fi
|
|
|
|
VERSION="$1"
|
|
|
|
set -e
|
|
|
|
# the temp folder to store binary file...
|
|
mkdir -p binary
|
|
rm -rf binary/clair || true
|
|
|
|
cd `dirname $0`
|
|
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 -
|
|
|
|
echo 'build the clair binary bases on the golang:1.7.3...'
|
|
cp Dockerfile.binary $TEMP
|
|
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/bin/clair binary
|
|
|
|
docker rm -f $ID
|
|
docker rmi -f clair-golang
|
|
|
|
echo "Build clair binary success, then to build photon image..."
|
|
cd $cur
|
|
rm -rf $TEMP
|