mirror of
https://github.com/stakater/Reloader.git
synced 2026-08-23 22:16:45 +00:00
build: update build configuration to use internal metadata package and improve ldflags injection, fix defer resp.Body.Close() usage, replace os.Setenv with t.Setenv in tests, correct error message casing, and adjust Dockerfile and Makefile for cmd/reloader structure
This commit is contained in:
+6
-6
@@ -23,9 +23,8 @@ COPY go.sum go.sum
|
||||
RUN go mod download
|
||||
|
||||
# Copy the go source
|
||||
COPY main.go main.go
|
||||
COPY cmd/ cmd/
|
||||
COPY internal/ internal/
|
||||
COPY pkg/ pkg/
|
||||
|
||||
# Build
|
||||
RUN CGO_ENABLED=0 \
|
||||
@@ -34,10 +33,11 @@ RUN CGO_ENABLED=0 \
|
||||
GOPROXY=${GOPROXY} \
|
||||
GOPRIVATE=${GOPRIVATE} \
|
||||
GO111MODULE=on \
|
||||
go build -ldflags="-s -w -X github.com/stakater/Reloader/pkg/common.Version=${VERSION} \
|
||||
-X github.com/stakater/Reloader/pkg/common.Commit=${COMMIT} \
|
||||
-X github.com/stakater/Reloader/pkg/common.BuildDate=${BUILD_DATE}" \
|
||||
-installsuffix 'static' -mod=mod -a -o manager ./
|
||||
go build -ldflags="-s -w \
|
||||
-X github.com/stakater/Reloader/internal/pkg/metadata.Version=${VERSION} \
|
||||
-X github.com/stakater/Reloader/internal/pkg/metadata.Commit=${COMMIT} \
|
||||
-X github.com/stakater/Reloader/internal/pkg/metadata.BuildDate=${BUILD_DATE}" \
|
||||
-installsuffix 'static' -mod=mod -a -o manager ./cmd/reloader
|
||||
|
||||
# Use distroless as minimal base image to package the manager binary
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
|
||||
Reference in New Issue
Block a user