We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d898e7a commit 6fcd53dCopy full SHA for 6fcd53d
Dockerfile
@@ -4,7 +4,7 @@ FROM golang:1.18 as build
4
WORKDIR /usr/src/wireproxy
5
COPY . .
6
7
-RUN CGO_ENABLED=0 go build ./cmd/wireproxy
+RUN make
8
9
# Now copy it into our base image.
10
FROM gcr.io/distroless/static-debian11:nonroot
Makefile
@@ -1,12 +1,14 @@
1
export GO ?= go
2
+export CGO_ENABLED = 0
3
+
+TAG := $(shell git describe --always --tags $(git rev-list --tags --max-count=1) --match v*)
.PHONY: all
all: wireproxy
.PHONY: wireproxy
wireproxy:
- tag="$$(git describe --tag 2>/dev/null)" && \
- ${GO} build -ldflags "-X 'main.version=$$tag'" ./cmd/wireproxy
11
+ ${GO} build -trimpath -ldflags "-s -w -X 'main.version=${TAG}'" ./cmd/wireproxy
12
13
.PHONY: clean
14
clean:
0 commit comments