diff --git a/Dockerfile b/Dockerfile index d18f854..c5cbbd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,13 +14,16 @@ COPY . . # 再执行一次 tidy(捕捉全部 import 依赖) RUN go mod tidy -# 编译可执行文件 +# 编译可执行文件(保留 CGo 支持) RUN go build -o license-server main.go -# 最小运行镜像 -FROM alpine:latest +# ✅ 运行镜像:改为 debian 支持 CGo 二进制 +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/ COPY --from=builder /app/license-server .