mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-28 19:47:58 +01:00
a5e7ac9164
This commit is to upgrade the golang version to 1.9.4, it because a bug of golang 17.3 could introduce one dns resolver issue for harbor mentioned by #6031. The bug of golang is https://github.com/golang/go/issues/15419, it makes harbor containers to lookup 'endpoint.' firstly which may cause network issue. Signed-off-by: wang yan <wangyan@vmware.com>
45 lines
869 B
Bash
Executable File
45 lines
869 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/notary-server || true
|
|
rm -rf binary/notary-signer || true
|
|
|
|
cd `dirname $0`
|
|
cur=$PWD
|
|
|
|
# the temp folder to store notary source code...
|
|
TEMP=`mktemp -d /$TMPDIR/notary.XXXXXX`
|
|
git clone -b $VERSION https://github.com/theupdateframework/notary.git $TEMP
|
|
|
|
echo 'build the notary binary bases on the golang:1.9.4...'
|
|
cp binary.Dockerfile $TEMP
|
|
cd $TEMP
|
|
docker build -f binary.Dockerfile -t notary-golang $TEMP
|
|
cp -r $TEMP/migrations binary
|
|
|
|
echo 'copy the notary binary to local...'
|
|
ID=$(docker create notary-golang)
|
|
echo $ID
|
|
cd $cur
|
|
docker cp $ID:/go/bin/notary-server binary
|
|
docker cp $ID:/go/bin/notary-signer binary
|
|
|
|
docker rm -f $ID
|
|
docker rmi -f notary-golang
|
|
|
|
rm -rf $TEMP
|
|
|
|
|