Skip to content

Commit 0d27360

Browse files
authored
πŸ”¨ The image source setting is changed to parametric parameter.
πŸ”¨ The image source setting is changed to parametric parameter.
2 parents 51fd63f + b7a2fda commit 0d27360

File tree

5 files changed

+34
-21
lines changed

5 files changed

+34
-21
lines changed

β€Ž.github/workflows/docker-build-push-mainland.ymlβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v4
2424
- name: Build main image (amd64) and load locally
2525
run: |
26-
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent:amd64 -f make/main/Dockerfile .
26+
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent:amd64 -f make/main/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
2727
- name: Login to Tencent Cloud
2828
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
2929
- name: Push main image (amd64) to Tencent Cloud
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/checkout@v4
4444
- name: Build main image (arm64) and load locally
4545
run: |
46-
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent:arm64 -f make/main/Dockerfile .
46+
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent:arm64 -f make/main/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
4747
- name: Login to Tencent Cloud
4848
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
4949
- name: Push main image (arm64) to Tencent Cloud
@@ -72,7 +72,7 @@ jobs:
7272
rm -rf .git .gitattributes
7373
- name: Build data process image (amd64) and load locally
7474
run: |
75-
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:amd64 -f make/data_process/Dockerfile .
75+
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:amd64 -f make/data_process/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
7676
- name: Login to Tencent Cloud
7777
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
7878
- name: Push data process image (amd64) to Tencent Cloud
@@ -101,7 +101,7 @@ jobs:
101101
rm -rf .git .gitattributes
102102
- name: Build data process image (arm64) and load locally
103103
run: |
104-
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:arm64 -f make/data_process/Dockerfile .
104+
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:arm64 -f make/data_process/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
105105
- name: Login to Tencent Cloud
106106
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
107107
- name: Push data process image (arm64) to Tencent Cloud
@@ -121,7 +121,7 @@ jobs:
121121
uses: actions/checkout@v4
122122
- name: Build web image (amd64) and load locally
123123
run: |
124-
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-web:amd64 -f make/web/Dockerfile .
124+
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-web:amd64 -f make/web/Dockerfile --build-arg MIRROR=https://registry.npmmirror.com --build-arg APK_MIRROR=tsinghua .
125125
- name: Login to Tencent Cloud
126126
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
127127
- name: Push web image (amd64) to Tencent Cloud
@@ -141,7 +141,7 @@ jobs:
141141
uses: actions/checkout@v4
142142
- name: Build web image (arm64) and load locally
143143
run: |
144-
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-web:arm64 -f make/web/Dockerfile .
144+
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-web:arm64 -f make/web/Dockerfile --build-arg MIRROR=https://registry.npmmirror.com --build-arg APK_MIRROR=tsinghua .
145145
- name: Login to Tencent Cloud
146146
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
147147
- name: Push web image (arm64) to Tencent Cloud

β€Ž.github/workflows/docker-deploy.ymlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fetch-depth: 1
2727
retries: 3
2828
- name: Build main application image
29-
run: docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent -f make/main/Dockerfile .
29+
run: docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua -t nexent/nexent -f make/main/Dockerfile .
3030

3131
build-data-process:
3232
runs-on: ${{ fromJson(inputs.runner_label_json) }}
@@ -53,7 +53,7 @@ jobs:
5353
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
5454
rm -rf .git .gitattributes
5555
- name: Build data process image
56-
run: docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple -t nexent/nexent-data-process -f make/data_process/Dockerfile .
56+
run: docker build --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua -t nexent/nexent-data-process -f make/data_process/Dockerfile .
5757

5858
build-web:
5959
runs-on: ${{ fromJson(inputs.runner_label_json) }}
@@ -64,7 +64,7 @@ jobs:
6464
fetch-depth: 1
6565
retries: 3
6666
- name: Build web frontend image
67-
run: docker build --build-arg MIRROR=https://registry.npmmirror.com -t nexent/nexent-web -f make/web/Dockerfile .
67+
run: docker build --build-arg MIRROR=https://registry.npmmirror.com --build-arg APK_MIRROR=tsinghua -t nexent/nexent-web -f make/web/Dockerfile .
6868

6969
build-docs:
7070
runs-on: ${{ fromJson(inputs.runner_label_json) }}

β€Žmake/data_process/Dockerfileβ€Ž

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
FROM python:3.10-slim
22
ARG MIRROR
3+
ARG APT_MIRROR
34
LABEL authors="nexent"
45

56
# Set correct permissions as root
67
USER root
78

8-
RUN rm -f /etc/apt/sources.list.d/* && \
9-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
10-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
11-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
12-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list
9+
# Configure apt sources based on build argument
10+
RUN if [ "$APT_MIRROR" = "tsinghua" ]; then \
11+
rm -f /etc/apt/sources.list.d/* && \
12+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
13+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
14+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
15+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list; \
16+
fi && \
17+
apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
1318

1419
RUN apt-get update && \
1520
apt-get install -y --no-install-recommends --fix-missing \

β€Žmake/main/Dockerfileβ€Ž

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
FROM python:3.10-slim
22
ARG MIRROR
3+
ARG APT_MIRROR
34
LABEL authors="nexent"
45

56
# Set correct permissions as root
67
USER root
78
RUN umask 0022
89

9-
RUN rm -f /etc/apt/sources.list.d/* && \
10-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
11-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
12-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
13-
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
10+
# Configure apt sources based on build argument
11+
RUN if [ "$APT_MIRROR" = "tsinghua" ]; then \
12+
rm -f /etc/apt/sources.list.d/* && \
13+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
14+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
15+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
16+
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list; \
17+
fi && \
1418
apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
1519

1620
RUN pip install --no-cache-dir uv $(test -n "$MIRROR" && echo "-i $MIRROR")

β€Žmake/web/Dockerfileβ€Ž

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ RUN if [ -n "$MIRROR" ]; then npm config set registry "$MIRROR"; fi && \
3939

4040
# Production stage
4141
FROM node:20-alpine
42+
ARG APK_MIRROR
4243
LABEL authors="nexent"
4344

44-
RUN echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main" > /etc/apk/repositories && \
45-
echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/community" >> /etc/apk/repositories && \
45+
# Configure Alpine mirrors if specified
46+
RUN if [ "$APK_MIRROR" = "tsinghua" ]; then \
47+
echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main" > /etc/apk/repositories && \
48+
echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/community" >> /etc/apk/repositories; \
49+
fi && \
4650
apk add --no-cache curl
4751

4852
WORKDIR /opt/frontend-dist

0 commit comments

Comments
Β (0)