change the base directory of prepare container in macOS (#21035)

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
This commit is contained in:
stonezdj(Daojun Zhang) 2024-10-15 15:54:32 +08:00 committed by GitHub
parent de6c96be4c
commit 4a5185995e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,12 +50,19 @@ fi
secret_dir=${data_path}/secret secret_dir=${data_path}/secret
config_dir=$harbor_prepare_path/common/config config_dir=$harbor_prepare_path/common/config
# Set the prepare base dir, for mac, it should be $HOME, for linux, it should be /
# The certificate and the data directory in harbor.yaml should be sub directories of $HOME when installing Harbor in MacOS
prepare_base_dir=/
if [ "$(uname)" == "Darwin" ]; then
prepare_base_dir=$HOME
fi
# Run prepare script # Run prepare script
docker run --rm -v $input_dir:/input \ docker run --rm -v $input_dir:/input \
-v $data_path:/data \ -v $data_path:/data \
-v $harbor_prepare_path:/compose_location \ -v $harbor_prepare_path:/compose_location \
-v $config_dir:/config \ -v $config_dir:/config \
-v /:/hostfs \ -v ${prepare_base_dir}:/hostfs${prepare_base_dir} \
--privileged \ --privileged \
goharbor/prepare:dev prepare $@ goharbor/prepare:dev prepare $@