This commit is contained in:
2026-09-02 17:28:32 +08:00
parent 3597eb264c
commit bb75c69d91
6 changed files with 5 additions and 1 deletions
+5 -1
View File
@@ -16,8 +16,12 @@ COPY . .
RUN CGO_ENABLED=0 go build -o /out/observer-server .
FROM alpine:3.20
# 国内网络 dl-cdn.alpinelinux.org 不通,默认走阿里云镜像;构建时可用 --build-arg 覆盖
ARG APK_MIRROR=https://mirrors.aliyun.com
# 时区对齐宿主(自然日授权语义依赖本地时区)
RUN apk add --no-cache tzdata && \
# apk 走 http_proxy 环境变量:清空 buildkit 注入的宿主代理(同上方 go mod download,容器内代理不通)
RUN sed -i "s#https://dl-cdn.alpinelinux.org#${APK_MIRROR}#g" /etc/apk/repositories && \
http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY= apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone
WORKDIR /app
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.