goircd/common.mk
Mathias Kaufmann eeb6782f0f Added make targets to build and push docker images
Usage:
`make docker-image` to build the image
`make docker-image-push` to build and push the image

Signed-off-by: Mathias Kaufmann <me@stei.gr>
2018-03-14 00:10:00 +01:00

19 lines
596 B
Makefile

LDFLAGS = -X main.version=$(VERSION)
goircd: *.go
go build -ldflags "$(LDFLAGS)"
docker-image: *.go Dockerfile .dockerignore
docker build -t $(shell basename $(PACKAGE)):$(VERSION) .
docker-image-push: docker-image-push-latest docker-image-push-version
@true
docker-image-push-version: docker-image-push-latest docker-image-push-version
docker tag $(shell basename $(PACKAGE)):$(VERSION) $(PACKAGE):$(VERSION)
docker push $(PACKAGE):$(VERSION)
docker-image-push-latest: docker-image
docker tag $(shell basename $(PACKAGE)):$(VERSION) $(PACKAGE):latest
docker push $(PACKAGE):latest