This commit is contained in:
2026-04-21 23:01:16 +08:00
parent 50052ef192
commit ddcba600ef
2 changed files with 4 additions and 4 deletions

View File

@@ -26,10 +26,10 @@ ARG COMMIT=dev
ARG BUILD_TIME
RUN BUILD_TIME=${BUILD_TIME:-$(date -u +"%Y-%m-%dT%H:%M:%SZ")} && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${BUILD_TIME} -w -s" \
-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=$$BUILD_TIME -w -s" \
-a -installsuffix cgo \
-o hyapi-server \
cmd/api/main.go
./cmd/api
# 第二阶段:运行阶段
FROM alpine:3.19

View File

@@ -26,10 +26,10 @@ ARG COMMIT=dev
ARG BUILD_TIME
RUN BUILD_TIME=${BUILD_TIME:-$(date -u +"%Y-%m-%dT%H:%M:%SZ")} && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${BUILD_TIME} -w -s" \
-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=$$BUILD_TIME -w -s" \
-a -installsuffix cgo \
-o worker \
cmd/worker/main.go
./cmd/worker
# 第二阶段:运行阶段
FROM alpine:3.19