update build chain

This commit is contained in:
xjasonlyu committed 2022-05-21 22:27:08 +08:00
1 parent 935c4df6d7
commit eac93c83c7
2 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -3,15 +3,15 @@ FROM golang:alpine AS builder
WORKDIR /src WORKDIR /src
COPY . /src COPY . /src
RUN CGO_ENABLED=0 go build -v -ldflags '-w -s -buildid=' -trimpath \ RUN apk add --update --no-cache --no-progress make git \
-o javtube-server cmd/server/main.go && make server
FROM alpine:latest FROM alpine:latest
LABEL org.opencontainers.image.source="https://github.com/javtube/javtube-sdk-go" LABEL org.opencontainers.image.source="https://github.com/javtube/javtube-sdk-go"
RUN apk --no-cache --no-progress add ca-certificates tzdata COPY --from=builder /src/build/javtube-server .
COPY --from=builder /src/javtube-server . RUN apk add --update --no-cache --no-progress ca-certificates tzdata
ENV GIN_MODE=release ENV GIN_MODE=release
ENV PORT=8080 ENV PORT=8080
+2 -2
View File
@@ -6,8 +6,8 @@ SERVER_CODE := cmd/server/main.go
BUILD_DIR := build BUILD_DIR := build
BUILD_TAGS := BUILD_TAGS :=
BUILD_FLAGS := -v BUILD_FLAGS := -v
BUILD_COMMIT := $(shell git rev-parse --short HEAD) #BUILD_COMMIT := $(shell git rev-parse --short HEAD)
BUILD_VERSION := $(shell git describe --abbrev=0 --tags HEAD) #BUILD_VERSION := $(shell git describe --abbrev=0 --tags HEAD)
CGO_ENABLED := 0 CGO_ENABLED := 0
GO111MODULE := on GO111MODULE := on