This commit is contained in:
hailin 2025-06-13 22:01:51 +08:00
parent 0a294da37e
commit 8fedd48f21
1 changed files with 7 additions and 4 deletions

View File

@ -14,13 +14,16 @@ COPY . .
# 再执行一次 tidy捕捉全部 import 依赖) # 再执行一次 tidy捕捉全部 import 依赖)
RUN go mod tidy RUN go mod tidy
# 编译可执行文件 # 编译可执行文件(保留 CGo 支持)
RUN go build -o license-server main.go RUN go build -o license-server main.go
# 最小运行镜像 # ✅ 运行镜像:改为 debian 支持 CGo 二进制
FROM alpine:latest FROM debian:bullseye-slim
RUN apk add --no-cache ca-certificates sqlite RUN apt-get update && apt-get install -y \
ca-certificates \
sqlite3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root/ WORKDIR /root/
COPY --from=builder /app/license-server . COPY --from=builder /app/license-server .