mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-03 06:35:00 +08:00
chore(build): migrate from Alpine to Debian and update build dependencies
- Updated `Dockerfile` base images from `golang:1.26-alpine` and `alpine:3.23` to `golang:1.26-bookworm` and `debian:bookworm`. - Replaced `apk` with `apt-get` for dependency installation. - Added `buildvcs=false` flag to Go build command for enhanced reproducibility.
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -1,8 +1,8 @@
|
||||
FROM golang:1.26-alpine AS builder
|
||||
FROM golang:1.26-bookworm AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache build-base
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends build-essential git && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
@@ -14,11 +14,11 @@ ARG VERSION=dev
|
||||
ARG COMMIT=none
|
||||
ARG BUILD_DATE=unknown
|
||||
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w -X 'main.Version=${VERSION}' -X 'main.Commit=${COMMIT}' -X 'main.BuildDate=${BUILD_DATE}'" -o ./CLIProxyAPI ./cmd/server/
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -buildvcs=false -ldflags="-s -w -X 'main.Version=${VERSION}' -X 'main.Commit=${COMMIT}' -X 'main.BuildDate=${BUILD_DATE}'" -o ./CLIProxyAPI ./cmd/server/
|
||||
|
||||
FROM alpine:3.23
|
||||
FROM debian:bookworm
|
||||
|
||||
RUN apk add --no-cache tzdata
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir /CLIProxyAPI
|
||||
|
||||
|
||||
Reference in New Issue
Block a user