Created
October 20, 2017 08:39
-
-
Save awalterschulze/022bba6161a4a724524f34150b4cd1f9 to your computer and use it in GitHub Desktop.
building go with a docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GODOCKER = docker run --network host --rm --user $(shell id -u):$(shell id -g) -v $(PWD):/go/src/path/to/project -w /go/src/path/to/project golang:1.8.3-alpine3.6 | |
GOFLAGS = -ldflags '-d' -tags netgo -installsuffix netgo | |
build: | |
$(GODOCKER) go build $(GOFLAGS) -o ./cmd/mycmd/mycmd ./cmd/mycmd | |
test: | |
$(GODOCKER) go test -test.v ./... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment