fix: use musl libc (#1597)

This commit is contained in:
zijiren
2024-07-06 13:14:07 +08:00
committed by GitHub
parent efd30a40b3
commit ffdb0b0c81
3 changed files with 7 additions and 5 deletions

View File

@@ -16,7 +16,9 @@ WORKDIR /web/air
RUN npm install
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
FROM golang AS builder2
FROM golang:alpine AS builder2
RUN apk add --no-cache g++
ENV GO111MODULE=on \
CGO_ENABLED=1 \
@@ -27,7 +29,7 @@ ADD go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=builder /web/build ./web/build
RUN go build -ldflags "-s -w -X 'github.com/songquanpeng/one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
RUN go build -trimpath -ldflags "-s -w -X 'github.com/songquanpeng/one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
FROM alpine