Merge pull request #2920 from laradock/reorganize-change-source
feat(change source): move together
This commit is contained in:
commit
d7a52d56be
@ -23,19 +23,26 @@ ARG LARADOCK_PHP_VERSION
|
||||
# Set Environment Variables
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
|
||||
|
||||
ARG CHANGE_SOURCE=false
|
||||
RUN if [ ${CHANGE_SOURCE} = true ]; then \
|
||||
# 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/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
|
||||
sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list \
|
||||
;fi
|
||||
|
||||
# Start as root
|
||||
USER root
|
||||
|
||||
###########################################################################
|
||||
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
|
||||
###########################################################################
|
||||
|
||||
ARG CHANGE_SOURCE=false
|
||||
ARG UBUNTU_SOURCE=aliyun
|
||||
COPY ./sources.sh /tmp/sources.sh
|
||||
RUN if [ ${CHANGE_SOURCE} = true ]; then \
|
||||
# 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/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list; \
|
||||
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:
|
||||
###########################################################################
|
||||
@ -46,16 +53,6 @@ ENV PUID ${PUID}
|
||||
ARG PGID=1000
|
||||
ENV PGID ${PGID}
|
||||
|
||||
ARG CHANGE_SOURCE=false
|
||||
ARG UBUNTU_SOURCE
|
||||
COPY ./sources.sh /tmp/sources.sh
|
||||
|
||||
RUN if [ ${CHANGE_SOURCE} = true ]; then \
|
||||
chmod +x /tmp/sources.sh && \
|
||||
/bin/sh -c /tmp/sources.sh && \
|
||||
rm -rf /tmp/sources.sh \
|
||||
;fi
|
||||
|
||||
# always run apt update when start and after add new source list, then clean up at end.
|
||||
RUN set -xe; \
|
||||
apt-get update -yqq && \
|
||||
|
Loading…
Reference in New Issue
Block a user