Skip to content

Commit

Permalink
Merge pull request #508 from jumpserver/dev
Browse files Browse the repository at this point in the history
v4.6.0
  • Loading branch information
BaiJiangJie authored Jan 15, 2025
2 parents d3194dc + bbd6a98 commit ba12760
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -624,20 +624,7 @@ function pull_image() {
IMAGE_PULL_POLICY=$(get_config_or_env 'IMAGE_PULL_POLICY')

if [[ "${DOCKER_IMAGE_MIRROR}" == "1" ]]; then
case "$(uname -m)" in
"x86_64")
DOCKER_IMAGE_PREFIX="swr.cn-north-1.myhuaweicloud.com"
;;
"aarch64")
DOCKER_IMAGE_PREFIX="swr.cn-north-4.myhuaweicloud.com"
;;
"loongarch64")
DOCKER_IMAGE_PREFIX="swr.cn-southwest-2.myhuaweicloud.com"
;;
"s390x")
DOCKER_IMAGE_PREFIX="swr.sa-brazil-1.myhuaweicloud.com"
;;
esac
DOCKER_IMAGE_PREFIX="registry.cn-beijing.aliyuncs.com/jumpservice"
else
DOCKER_IMAGE_PREFIX=$(get_config_or_env 'DOCKER_IMAGE_PREFIX')
fi
Expand All @@ -664,13 +651,19 @@ function pull_image() {
echo "[${image}] pulling"
full_image_path="${image}"
if [[ -n "${DOCKER_IMAGE_PREFIX}" ]]; then
if [[ $(image_has_prefix "${image}") != "1" ]]; then
if echo "${DOCKER_IMAGE_PREFIX}" | grep -q "/";then
app=$(echo "$image" | awk -F'/' '{ print $NF }')
full_image_path="${DOCKER_IMAGE_PREFIX}/${app}"
elif [[ $(image_has_prefix "${image}") != "1" ]]; then
full_image_path="${DOCKER_IMAGE_PREFIX}/jumpserver/${image}"
else
full_image_path="${DOCKER_IMAGE_PREFIX}/${image}"
fi
fi

if [[ "${full_image_path}" != "${image}" ]]; then
echo " -> [${full_image_path}]"
fi
docker pull ${pull_args} "${full_image_path}"
if [[ "${full_image_path}" != "${image}" ]]; then
docker tag "${full_image_path}" "${image}"
Expand Down

0 comments on commit ba12760

Please sign in to comment.