From bb4a2e2897b1d439134d6b69adc8b0f7c25217f7 Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Wed, 19 Feb 2025 08:58:46 +0000 Subject: [PATCH] chore: comment out CI steps and update Dockerfile for multi-arch support --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8cc0d00..132b17e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ sqlite3 libsqlite3-dev && \ rm -rf /var/lib/apt/lists/* -# TARGETARCH should be set by BuildKit when building multi-arch images. +# Declare TARGETARCH so BuildKit can set it correctly. +ARG TARGETARCH=amd64 ENV GO111MODULE=on \ CGO_ENABLED=1 \ GOOS=linux \ @@ -37,14 +38,14 @@ RUN go mod download COPY . . COPY --from=builder /web/build ./web/build -# Use double quotes for the -ldflags parameter so that the $(cat VERSION) is expanded. RUN go build -trimpath -ldflags "-s -w -X github.com/songquanpeng/one-api/common.Version=$(cat VERSION)" -o one-api -# Final runtime image FROM debian:bullseye +RUN rm /var/lib/dpkg/info/libc-bin.* + RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates tzdata bash haveged ffmpeg && \ + ca-certificates tzdata bash haveged libc-bin ffmpeg && \ rm -rf /var/lib/apt/lists/* COPY --from=builder2 /build/one-api /