File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,14 +38,17 @@ ENV PIP_NO_CACHE_DIR=1 \
3838
3939# psycopg ships binary wheels for amd64 and arm64, the two platforms this
4040# project publishes; the remaining ones compile against libpq, which needs a
41- # toolchain in the builder stage only -- never the runtime layer.
41+ # toolchain in the builder stage only -- never the runtime layer. git is always
42+ # required: the sibling dependencies install from git URLs, and pip shells out
43+ # to the git binary for those.
4244RUN set -eux; \
4345 case "$TARGETPLATFORM" in \
4446 linux/amd64 | linux/arm64) \
45- echo "binary wheels expected for $TARGETPLATFORM; skipping build tools" ;; \
46- *) \
47- apt-get update && apt-get install -y --no-install-recommends gcc libpq-dev \
47+ apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
4848 && rm -rf /var/lib/apt/lists/* ;; \
49+ *) \
50+ apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
51+ gcc libpq-dev && rm -rf /var/lib/apt/lists/* ;; \
4952 esac
5053
5154RUN python -m venv /opt/venv
Original file line number Diff line number Diff line change @@ -33,6 +33,22 @@ docker buildx bake --set citracker.platform=linux/amd64 --load
3333mcpserver),与 CI 检出的 ref 相同;三者均已公开,构建无需 token。将来发布
3434到 PyPI 后,把 ` Dockerfile ` 里的 git URL 换成版本钉死即可。
3535
36+ ### 本地构建的代理分流
37+
38+ 在本机(代理走海外节点)构建时,GitHub 要代理、阿里云镜像要直连,用
39+ ` NO_PROXY ` 分流,缺一不可:
40+
41+ ``` powershell
42+ docker build -t citracker:local `
43+ --build-arg HTTP_PROXY=http://host.docker.internal:7897 `
44+ --build-arg HTTPS_PROXY=http://host.docker.internal:7897 `
45+ --build-arg NO_PROXY=mirrors.aliyun.com,localhost,127.0.0.1,::1 .
46+ ```
47+
48+ ` host.docker.internal ` 是从构建容器访问宿主机代理的地址(容器内的
49+ ` 127.0.0.1 ` 是它自己)。CI(Actions)网络不受此限,直接构建即可。基础镜像
50+ 已本地打过标签时可完全离线构建。
51+
3652## 镜像发布(GitHub Actions)
3753
3854` images.yml ` 由 GitHub Actions 构建并推送到阿里云镜像仓库( runners 不受
You can’t perform that action at this time.
0 commit comments