From 51ed2c83faaa4da08e45b853383a6dcd90d14aba Mon Sep 17 00:00:00 2001 From: DDSRem <1448139087@qq.com> Date: Sat, 11 Feb 2023 18:50:02 +0800 Subject: [PATCH] feat: custom software sources --- docker/Dockerfile | 2 ++ docker/Dockerfile.beta | 2 ++ docker/Dockerfile.lite | 2 ++ docker/entrypoint.sh | 6 +++--- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9279c1299..0ab116a6f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,6 +22,8 @@ ENV LANG="C.UTF-8" \ NASTOOL_VERSION=master \ PS1="\u@\h:\w \$ " \ REPO_URL="https://github.com/jxxghp/nas-tools.git" \ + PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" \ + ALPINE_MIRROR="mirrors.ustc.edu.cn" \ PUID=0 \ PGID=0 \ UMASK=000 \ diff --git a/docker/Dockerfile.beta b/docker/Dockerfile.beta index a6a91b4a2..556c3c962 100644 --- a/docker/Dockerfile.beta +++ b/docker/Dockerfile.beta @@ -22,6 +22,8 @@ ENV LANG="C.UTF-8" \ NASTOOL_VERSION=dev \ PS1="\u@\h:\w \$ " \ REPO_URL="https://github.com/jxxghp/nas-tools.git" \ + PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" \ + ALPINE_MIRROR="mirrors.ustc.edu.cn" \ PUID=0 \ PGID=0 \ UMASK=000 \ diff --git a/docker/Dockerfile.lite b/docker/Dockerfile.lite index 9052b3245..6e39b2371 100644 --- a/docker/Dockerfile.lite +++ b/docker/Dockerfile.lite @@ -29,6 +29,8 @@ ENV LANG="C.UTF-8" \ NASTOOL_VERSION=lite \ PS1="\u@\h:\w \$ " \ REPO_URL="https://github.com/jxxghp/nas-tools.git" \ + PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" \ + ALPINE_MIRROR="mirrors.ustc.edu.cn" \ PUID=0 \ PGID=0 \ UMASK=000 \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b963b0ab0..d6fd3246b 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -32,8 +32,8 @@ if [ "${NASTOOL_AUTO_UPDATE}" = "true" ]; then if [ "${hash_old}" != "${hash_new}" ]; then echo "检测到requirements.txt有变化,重新安装依赖..." if [ "${NASTOOL_CN_UPDATE}" = "true" ]; then - pip install --upgrade pip setuptools wheel -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple + pip install --upgrade pip setuptools wheel -i "${PYPI_MIRROR}" + pip install -r requirements.txt -i "${PYPI_MIRROR}" else pip install --upgrade pip setuptools wheel pip install -r requirements.txt @@ -64,7 +64,7 @@ if [ "${NASTOOL_AUTO_UPDATE}" = "true" ]; then if [ "${hash_old}" != "${hash_new}" ]; then echo "检测到package_list.txt有变化,更新软件包..." if [ "${NASTOOL_CN_UPDATE}" = "true" ]; then - sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories + sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_MIRROR}/g" /etc/apk/repositories apk update -f fi apk add --no-cache libffi-dev