Skip to content

Commit

Permalink
another attempt at vcs info in docker binary
Browse files Browse the repository at this point in the history
  • Loading branch information
capnspacehook committed Oct 30, 2022
1 parent 91a8d94 commit 97a55fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install cosign
uses: sigstore/cosign-installer@main
Expand Down
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ builds:
- amd64
flags:
- -buildmode=pie
- -buildvcs=true
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apk add --no-cache git=2.36.3-r0
# build as PIE to take advantage of exploit mitigations
ARG CGO_ENABLED=0
ARG VERSION
RUN go build -buildmode pie -ldflags "-s -w -X main.version=${VERSION}" -trimpath -o go-project-template
RUN go build -buildmode=pie -buildvcs=true -ldflags "-s -w -X main.version=${VERSION}" -trimpath -o go-project-template

# pie-loader is built and scanned daily, we want the most recent version
# hadolint ignore=DL3006
Expand Down

0 comments on commit 97a55fc

Please sign in to comment.