Makefile: add build-in-docker target
This target does the same as `make` but inside a Docker container. That
is, build lokoctl in Docker and then place the resulting binary in the
root of the repo.
@@ -27,6 +27,11 @@ LDFLAGS := "-X github.com/kinvolk/lokomotive/pkg/version.Version=$(VERSION) -ext
.PHONY: build
build: update-assets build-slim
+.PHONY: build-in-docker
+build-in-docker:
+ # increase ulimit to workaround https://github.com/golang/go/issues/37436
+ docker run --ulimit memlock=1024000 --rm -ti -v $(shell pwd):/usr/src/lokomotive -w /usr/src/lokomotive golang:1.14 sh -c "make"
+
.PHONY: build-test
build-test:
go test -run=nonexistent -mod=$(MOD) -tags="aws,packet,e2e,disruptive-e2e" -covermode=atomic -buildmode=exe -v ./...
