From 40d878e8a9514e5ea288d33d94f3c3ca86fd0daa Mon Sep 17 00:00:00 2001 From: "1808837298@qq.com" <1808837298@qq.com> Date: Tue, 11 Feb 2025 18:51:09 +0800 Subject: [PATCH] chore: disable cgo --- Dockerfile | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4afb85f2..0578928c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,25 +9,16 @@ RUN DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat VERSION) bun run b FROM golang:alpine AS builder2 -RUN apk add --no-cache \ - gcc \ - musl-dev \ - sqlite-dev \ - build-base - ENV GO111MODULE=on \ - CGO_ENABLED=1 \ + CGO_ENABLED=0 \ GOOS=linux WORKDIR /build - ADD go.mod go.sum ./ RUN go mod download - COPY . . COPY --from=builder /build/dist ./web/dist -RUN go build -trimpath -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -linkmode external -extldflags '-static'" -o one-api - +RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api FROM alpine