Merge pull request #3045 from amorZhu/master

Update workspace and php-fpm mirror links
This commit is contained in:
Shao Yu-Lung (Allen) 2021-08-31 22:47:22 +08:00 committed by GitHub
commit fffe51c51c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 101 deletions

View File

@ -74,8 +74,6 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1
# If you need to change the sources (i.e. to China), set CHANGE_SOURCE to true # If you need to change the sources (i.e. to China), set CHANGE_SOURCE to true
CHANGE_SOURCE=false CHANGE_SOURCE=false
# Set CHANGE_SOURCE and UBUNTU_SOURCE option if you want to change the Ubuntu system sources.list file.
UBUNTU_SOURCE=aliyun
# Set ORACLE INSTANT_CLIENT_MIRROR option if you want to use Intranet improve download, you can download files first # Set ORACLE INSTANT_CLIENT_MIRROR option if you want to use Intranet improve download, you can download files first
ORACLE_INSTANT_CLIENT_MIRROR=https://github.com/diogomascarenha/oracle-instantclient/raw/master/ ORACLE_INSTANT_CLIENT_MIRROR=https://github.com/diogomascarenha/oracle-instantclient/raw/master/

View File

@ -78,8 +78,6 @@ cp .env.example .env
``` ```
# 开启ubuntu国内源 # 开启ubuntu国内源
CHANGE_SOURCE=true CHANGE_SOURCE=true
# 默认是阿里云可选项有aliyun|zju|tsinghua|163|ustc
UBUNTU_SOURCE=aliyun
# composer镜像源 # composer镜像源
WORKSPACE_COMPOSER_REPO_PACKAGIST=https://mirrors.aliyun.com/composer/ WORKSPACE_COMPOSER_REPO_PACKAGIST=https://mirrors.aliyun.com/composer/
# nvm镜像源 # nvm镜像源

View File

@ -66,7 +66,6 @@ services:
- SHELL_OH_MY_ZSH=${SHELL_OH_MY_ZSH} - SHELL_OH_MY_ZSH=${SHELL_OH_MY_ZSH}
- SHELL_OH_MY_ZSH_AUTOSUGESTIONS=${SHELL_OH_MY_ZSH_AUTOSUGESTIONS} - SHELL_OH_MY_ZSH_AUTOSUGESTIONS=${SHELL_OH_MY_ZSH_AUTOSUGESTIONS}
- SHELL_OH_MY_ZSH_ALIASES=${SHELL_OH_MY_ZSH_ALIASES} - SHELL_OH_MY_ZSH_ALIASES=${SHELL_OH_MY_ZSH_ALIASES}
- UBUNTU_SOURCE=${UBUNTU_SOURCE}
- BASE_IMAGE_TAG_PREFIX=${WORKSPACE_BASE_IMAGE_TAG_PREFIX} - BASE_IMAGE_TAG_PREFIX=${WORKSPACE_BASE_IMAGE_TAG_PREFIX}
- LARADOCK_PHP_VERSION=${PHP_VERSION} - LARADOCK_PHP_VERSION=${PHP_VERSION}
- LARADOCK_PHALCON_VERSION=${PHALCON_VERSION} - LARADOCK_PHALCON_VERSION=${PHALCON_VERSION}

View File

@ -28,9 +28,9 @@ ENV DEBIAN_FRONTEND noninteractive
ARG CHANGE_SOURCE=false ARG CHANGE_SOURCE=false
RUN if [ ${CHANGE_SOURCE} = true ]; then \ RUN if [ ${CHANGE_SOURCE} = true ]; then \
# Change application source from deb.debian.org to aliyun source # Change application source from deb.debian.org to aliyun source
sed -i 's/deb.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \ sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
sed -i 's/security.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \ sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
sed -i 's/security-cdn.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list \ sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list \
;fi ;fi
# always run apt update when start and after add new source list, then clean up at end. # always run apt update when start and after add new source list, then clean up at end.

View File

@ -31,17 +31,10 @@ USER root
########################################################################### ###########################################################################
ARG CHANGE_SOURCE=false ARG CHANGE_SOURCE=false
ARG UBUNTU_SOURCE=aliyun
COPY ./sources.sh /tmp/sources.sh
RUN if [ ${CHANGE_SOURCE} = true ]; then \ RUN if [ ${CHANGE_SOURCE} = true ]; then \
# Change application source from deb.debian.org to aliyun source # Change application source from deb.debian.org to aliyun source
sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list; \ sed -i 's/ports.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list; \
sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list; \ fi;
sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list; \
chmod +x /tmp/sources.sh; \
/bin/sh -c /tmp/sources.sh; \
fi; \
rm -rf /tmp/sources.sh
########################################################################### ###########################################################################
# Laradock non-root user: # Laradock non-root user:
@ -715,7 +708,7 @@ ENV NVM_NODEJS_ORG_MIRROR ${NVM_NODEJS_ORG_MIRROR}
RUN if [ ${INSTALL_NODE} = true ]; then \ RUN if [ ${INSTALL_NODE} = true ]; then \
# Install nvm (A Node Version Manager) # Install nvm (A Node Version Manager)
mkdir -p $NVM_DIR && \ mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash \
&& . $NVM_DIR/nvm.sh \ && . $NVM_DIR/nvm.sh \
&& nvm install ${NODE_VERSION} \ && nvm install ${NODE_VERSION} \
&& nvm use ${NODE_VERSION} \ && nvm use ${NODE_VERSION} \

View File

@ -1,83 +0,0 @@
#!/bin/bash
set -xe;
if type "tee" 2>/dev/null && [ -n "${UBUNTU_SOURCE}" ]; then
SOURCE_PATH="/etc/apt/sources.list"
cp ${SOURCE_PATH} ${SOURCE_PATH}.bak && rm -rf ${SOURCE_PATH}
case "${UBUNTU_SOURCE}" in
"aliyun")
tee ${SOURCE_PATH} <<-'EOF'
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
EOF
;;
"zju")
tee ${SOURCE_PATH} <<-'EOF'
deb http://mirrors.zju.edu.cn/ubuntu/ focal main multiverse restricted universe
deb http://mirrors.zju.edu.cn/ubuntu/ focal-backports main multiverse restricted universe
deb http://mirrors.zju.edu.cn/ubuntu/ focal-proposed main multiverse restricted universe
deb http://mirrors.zju.edu.cn/ubuntu/ focal-security main multiverse restricted universe
deb http://mirrors.zju.edu.cn/ubuntu/ focal-updates main multiverse restricted universe
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal main multiverse restricted universe
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-backports main multiverse restricted universe
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-proposed main multiverse restricted universe
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-security main multiverse restricted universe
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-updates main multiverse restricted universe
EOF
;;
"tsinghua")
tee ${SOURCE_PATH} <<-'EOF'
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
EOF
;;
"163")
tee ${SOURCE_PATH} <<-'EOF'
deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
EOF
;;
"ustc")
tee ${SOURCE_PATH} <<-'EOF'
deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
EOF
;;
*)
echo "Please check whether there is aliyun|zju|tsinghua|163|ustc in the parameter"
exit 1;;
esac
fi