diff --git a/.goreleaser.yml b/.goreleaser.yml index 396f02f..3c27bc9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,10 +1,22 @@ builds: - env: - CGO_ENABLED=0 + flags: + - -trimpath + - -buildvcs=false + ldflags: + - -s -w -buildid= -X main.version={{ .Version }} goos: - linux - windows - darwin +upx: + - enabled: true + compress: best + lzma: true + goos: + - linux + archives: - id: binary format: binary diff --git a/Dockerfile b/Dockerfile index 773c990..3997893 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY . . ENV GOTOOLCHAIN=local RUN apk add --no-cache ca-certificates && \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w' ./gitlab-ci-validate.go + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -buildvcs=false -tags netgo -ldflags '-s -w -buildid=' ./gitlab-ci-validate.go FROM scratch