Skip to content

Commit 24361ca

Browse files
committed
add ubuntu sources.list
1 parent b5314e5 commit 24361ca

4 files changed

Lines changed: 9 additions & 85 deletions

File tree

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ services:
133133
- http_proxy
134134
- https_proxy
135135
- no_proxy
136+
- CHANGE_SOURCE=${CHANGE_SOURCE}
137+
- UBUNTU_SOURCE=${UBUNTU_SOURCE}
136138
volumes:
137139
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
138140
- ./php-worker/supervisord.d:/etc/supervisord.d
@@ -156,6 +158,7 @@ services:
156158
context: ./php-fpm
157159
args:
158160
- CHANGE_SOURCE=${CHANGE_SOURCE}
161+
- UBUNTU_SOURCE=${UBUNTU_SOURCE}
159162
- LARADOCK_PHP_VERSION=${PHP_VERSION}
160163
- LARADOCK_PHALCON_VERSION=${PHALCON_VERSION}
161164
- INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG}

env-example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1
6969

7070
# If you need to change the sources (i.e. to China), set CHANGE_SOURCE to true
7171
CHANGE_SOURCE=false
72+
# Set CHANGE_SOURCE and UBUNTU_SOURCE option if you want to change the Ubuntu system sources.list file.
73+
UBUNTU_SOURCE=aliyun
7274

7375
### Docker Sync ###########################################
7476

workspace/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ ENV PUID ${PUID}
3636
ARG PGID=1000
3737
ENV PGID ${PGID}
3838

39+
ARG CHANGE_SOURCE=false
40+
ARG UBUNTU_SOURCE
3941
COPY ./sources.sh /tmp/sources.sh
4042

4143
RUN if [ ${CHANGE_SOURCE} = true ]; then \
42-
chmod +x /tmp/sources.sh && \
43-
# bash /tmp/sources.sh aliyun
44-
# ./tmp/sources.sh aliyun
45-
/bin/bash /tmp/sources.sh aliyun && \
44+
/bin/sh -c /tmp/sources.sh ${UBUNTU_SOURCE} && \
45+
rm -rf /tmp/sources.sh \
4646
;fi
4747

4848
# always run apt update when start and after add new source list, then clean up at end.

workspace/sources.sh

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)