mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-30 06:03:45 +01:00
3dfddfdf4e
Fixes #12850 This patch can fix the GC failure in the NFS v3 env, see https://github.com/distribution/distribution/pull/3309#issuecomment-783606968 Signed-off-by: Wang Yan <wangyan@vmware.com>
56 lines
1.3 KiB
Bash
Executable File
56 lines
1.3 KiB
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/registry || true
|
|
|
|
cd `dirname $0`
|
|
cur=$PWD
|
|
|
|
# the temp folder to store distribution source code...
|
|
TEMP=`mktemp -d ${TMPDIR-/tmp}/distribution.XXXXXX`
|
|
git clone -b $VERSION https://github.com/distribution/distribution.git $TEMP
|
|
|
|
# add patch 2879
|
|
echo 'add patch https://github.com/distribution/distribution/pull/2879 ...'
|
|
cd $TEMP
|
|
wget https://github.com/distribution/distribution/pull/2879.patch
|
|
git apply 2879.patch
|
|
|
|
# add patch 3370
|
|
echo 'add patch https://github.com/distribution/distribution/pull/3370 ...'
|
|
cd $TEMP
|
|
wget https://github.com/distribution/distribution/pull/3370.patch
|
|
git apply 3370.patch
|
|
|
|
# add patch redis
|
|
git apply $cur/redis.patch
|
|
cd $cur
|
|
|
|
echo 'build the registry binary ...'
|
|
cp Dockerfile.binary $TEMP
|
|
docker build -f $TEMP/Dockerfile.binary -t registry-golang $TEMP
|
|
|
|
echo 'copy the registry binary to local...'
|
|
ID=$(docker create registry-golang)
|
|
docker cp $ID:/go/src/github.com/docker/distribution/bin/registry binary/registry
|
|
|
|
docker rm -f $ID
|
|
docker rmi -f registry-golang
|
|
|
|
echo "Build registry binary success, then to build photon image..."
|
|
cd $cur
|
|
cp $TEMP/cmd/registry/config-example.yml config.yml
|
|
rm -rf $TEMP
|