build(docker): apply the apk mirror swap to the runner stage

- Add apk mirror swap to mirrors.aliyun.com at the top of runner stage
- Prevents docker build hanging when dl-cdn.alpinelinux.org is unreachable
This commit is contained in:
82030615
2026-09-21 20:20:54 +07:00
parent be3bc764b1
commit c7df895bbb

View File

@@ -18,6 +18,10 @@ RUN npm run build
FROM ${NODE_IMAGE} AS runner FROM ${NODE_IMAGE} AS runner
WORKDIR /app WORKDIR /app
# The base stage's mirror swap does not reach here: runner starts from
# ${NODE_IMAGE} directly, so the apk upgrade below would go to
# dl-cdn.alpinelinux.org and hang forever on networks that cannot reach it.
RUN sed -i 's|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g' /etc/apk/repositories
LABEL org.opencontainers.image.title="9router" LABEL org.opencontainers.image.title="9router"