From 4a5185995e4413046e7ec97aacd2ce52fc732c01 Mon Sep 17 00:00:00 2001 From: "stonezdj(Daojun Zhang)" Date: Tue, 15 Oct 2024 15:54:32 +0800 Subject: [PATCH] change the base directory of prepare container in macOS (#21035) Signed-off-by: stonezdj --- make/prepare | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/make/prepare b/make/prepare index c0ef48262..8742c150e 100755 --- a/make/prepare +++ b/make/prepare @@ -50,12 +50,19 @@ fi secret_dir=${data_path}/secret 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 docker run --rm -v $input_dir:/input \ -v $data_path:/data \ -v $harbor_prepare_path:/compose_location \ -v $config_dir:/config \ - -v /:/hostfs \ + -v ${prepare_base_dir}:/hostfs${prepare_base_dir} \ --privileged \ goharbor/prepare:dev prepare $@