renwei 1f7ca4fa82 Add Prisma engines mirror
The Prisma CLI downloads its engine binaries from binaries.prisma.sh, which the npm registry mirror does not cover. In-office builds therefore either hit the public CDN or hard-code a mirror in each project's Dockerfile. Point PRISMA_ENGINES_MIRROR (plus the legacy PRISMA_BINARIES_MIRROR alias) at npmmirror's binary mirror when a private Nexus is reachable.

persist_env() exports the value and also writes it to /etc/environment, so a consumer that needs it in a later Docker RUN can source the script in that step.

Tested: sh -n passes; persist_env exports and updates /etc/environment without duplicating entries.
2026-10-08 17:30:31 +08:00
2026-10-08 17:30:31 +08:00

Smart Mirror

A simple script to speed up docker build by using mirror sites in China.

How it works

It checks if your are in China office by checking nexus.tdology.com`IP. If yes(a private IP address, but not a public one), It tries to use the mirror sites in China for speeding up the build.

How to use

In your Dockerfile, try to run the script before doing anything, e.g.

FROM alpine:3.18
ADD https://git.piicloud.cn/public/smart-mirror/raw/branch/main/smart-mirror.sh /tmp/smart-mirror.sh
RUN sh /tmp/smart-mirror.sh
ENV no_proxy=nexus.tdology.com,localhost,127.0.0.1
ENV NO_PROXY=nexus.tdology.com,localhost,127.0.0.1

or

FROM alpine:3.18
RUN curl -fsSL https://git.piicloud.cn/public/smart-mirror/raw/branch/main/smart-mirror.sh | sh
S
Description
No description provided
Readme 82 KiB
Languages
Shell 100%