Skip to content

Commit

Permalink
Add -trimpath to build flags (drop unnecessary netgo flags)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Jan 19, 2024
1 parent f411f5e commit cd335f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ RUN set -eux; \

COPY . .

RUN go build -v -o /usr/local/bin/rawdns ./cmd/rawdns
RUN go build -v -trimpath -o /usr/local/bin/rawdns ./cmd/rawdns

CMD ["rawdns"]
2 changes: 1 addition & 1 deletion Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN [ -z "$(ls -A1 /go/bin || :)" ]
# disable CGO for ALL THE THINGS (to help ensure no libc)
ENV CGO_ENABLED 0

ENV GOFLAGS="-v -a -tags=netgo -installsuffix=netgo"
ENV GOFLAGS="-v -a -trimpath"
# https://golang.org/issue/26849
ENV BUILD_FLAGS="-ldflags '-d -w' ./cmd/rawdns"
# intentionally *not* including "-s" so that we can run "govulncheck" on the result (minor size increase)
Expand Down

0 comments on commit cd335f6

Please sign in to comment.