Skip to content

Commit

Permalink
build: include version tags and reduce build size
Browse files Browse the repository at this point in the history
  • Loading branch information
systemmonkey42 authored and libvoid committed Jun 5, 2023
1 parent 2dcd666 commit 103e8d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ DOCKER_IMAGE ?= moul/sshportal
VERSION ?= `git describe --tags --always`
VCS_REF ?= `git rev-parse --short HEAD`
GO_INSTALL_OPTS = -ldflags="-X main.GitSha=$(VCS_REF) -X main.GitTag=$(VERSION)"
LDFLAGS = -w -s
GO_BUILD_OPTS = -ldflags="-X main.GitSha=$(VCS_REF) -X main.GitTag=$(VERSION) -extldflags '-static' $(LDFLAGS)"
PORT ?= 2222

include rules.mk
Expand All @@ -18,7 +20,7 @@ integration:

.PHONY: _docker_install
_docker_install:
CGO_ENABLED=1 $(GO) build -ldflags '-extldflags "-static" $(LDFLAGS)' -tags netgo -v -o /go/bin/sshportal
CGO_ENABLED=1 $(GO) build $(GO_BUILD_OPTS) -tags netgo -v -o /go/bin/sshportal

.PHONY: dev
dev:
Expand Down

0 comments on commit 103e8d8

Please sign in to comment.