Makefile 510 B

12345678910111213141516171819202122232425262728293031
  1. DIST=dist.tar.gz
  2. all: $(DIST)
  3. local:
  4. GOPATH=$(CURDIR)/deps:$(CURDIR) go get sampleapp/cmd/server
  5. GOPATH=$(CURDIR)/deps:$(CURDIR) go build -o bin/sampleapp sampleapp/cmd/server
  6. #builder
  7. $(DIST):
  8. docker build --rm -t sampleapp-build -f docker/Dockerfile.build .
  9. docker run sampleapp-build > $(DIST)
  10. # Distribution docker, small, clean
  11. dist: $(DIST)
  12. docker build -t sampleapp -f docker/Dockerfile.dist .
  13. clean:
  14. rm $(DIST)
  15. distclean:
  16. rm -rf bin
  17. rm -rf pkg
  18. rm -rf deps
  19. .PHONY: clean dist all