diff --git a/Dockerfile b/Dockerfile index 918d4a3c..d0a619ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,12 @@ WORKDIR /web/air RUN npm install RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build -FROM golang:alpine AS builder2 +FROM golang:1.22.5-bullseye AS builder2 -RUN apk add --no-cache g++ +RUN apt-get update +RUN apt-get install -y --no-install-recommends g++ make gcc git build-essential ca-certificates \ + && update-ca-certificates 2>/dev/null || true \ + && rm -rf /var/lib/apt/lists/* ENV GO111MODULE=on \ CGO_ENABLED=1 \ @@ -25,17 +28,12 @@ ADD go.mod go.sum ./ RUN go mod download COPY . . COPY --from=builder /web/build ./web/build -RUN go build -trimpath -ldflags "-s -w -X 'github.com/songquanpeng/one-api/common.Version=$(cat VERSION)'" -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 debian:bullseye RUN apt-get update RUN apt-get install -y --no-install-recommends ca-certificates haveged tzdata \ - # for google-chrome - # libappindicator1 fonts-liberation xdg-utils wget \ - # libasound2 libatk-bridge2.0-0 libatspi2.0-0 libcurl3-gnutls libcurl3-nss \ - # libcurl4 libcurl3 libdrm2 libgbm1 libgtk-3-0 libgtk-4-1 libnspr4 libnss3 \ - # libu2f-udev libvulkan1 libxkbcommon0 \ && update-ca-certificates 2>/dev/null || true \ && rm -rf /var/lib/apt/lists/*