Skip to content

Commit

Permalink
Add ldflags to shrink image size
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagai Barel committed Jun 2, 2019
1 parent 0f807f5 commit b1e26cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ HAS_DEP := $(shell command -v dep;)
DEP_VERSION := v0.5.0
GIT_TAG := $(shell git describe --tags --always)
GIT_COMMIT := $(shell git rev-parse --short HEAD)
LDFLAGS := "-X main.GitTag=${GIT_TAG} -X main.GitCommit=${GIT_COMMIT}"
LDFLAGS := "-s -w -X main.GitTag=${GIT_TAG} -X main.GitCommit=${GIT_COMMIT}"
DIST := $(CURDIR)/dist
DOCKER_USER := $(shell printenv DOCKER_USER)
DOCKER_PASSWORD := $(shell printenv DOCKER_PASSWORD)
Expand All @@ -21,7 +21,7 @@ test: fmt vet
go test ./... -coverprofile cover.out

# Build orca binary
build: fmt vet
build: test
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/orca cmd/orca.go

# Build orca docker image
Expand Down

0 comments on commit b1e26cd

Please sign in to comment.