aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-11-07 14:12:01 +0000
committerGravatar Miek Gieben <miek@miek.nl> 2016-11-07 14:12:01 +0000
commit769d42247eb3deba144235f264c477b18941d548 (patch)
tree025cced98908108abd531327394ad4fe69349e3c /Makefile
parent3d5be649a293d5eb63537b653f574d4227cdd916 (diff)
downloadcoredns-769d42247eb3deba144235f264c477b18941d548.tar.gz
coredns-769d42247eb3deba144235f264c477b18941d548.tar.zst
coredns-769d42247eb3deba144235f264c477b18941d548.zip
Add docker tagging
Small tweak to tag docker image with current release number.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7f6539869..c16535c7d 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ BUILD_VERBOSE := -v
TEST_VERBOSE := -v
DOCKER_IMAGE_NAME := $$USER/coredns
+DOCKER_VERSION := $(shell grep 'coreVersion' coremain/version.go | awk '{ print $$3 }' | tr -d '"')
all: coredns
@@ -16,6 +17,7 @@ coredns: deps
docker: deps
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w"
docker build -t $(DOCKER_IMAGE_NAME) .
+ docker tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):$(DOCKER_VERSION)
.PHONY: deps
deps:
@@ -51,7 +53,7 @@ distclean: clean
# Clean all dependencies and build artifacts
find $(GOPATH)/pkg -maxdepth 1 -mindepth 1 | xargs rm -rf
find $(GOPATH)/bin -maxdepth 1 -mindepth 1 | xargs rm -rf
-
+
find $(GOPATH)/src -maxdepth 1 -mindepth 1 | grep -v github | xargs rm -rf
find $(GOPATH)/src -maxdepth 2 -mindepth 2 | grep -v miekg | xargs rm -rf
find $(GOPATH)/src/github.com/miekg -maxdepth 1 -mindepth 1 \! -name \*coredns\* | xargs rm -rf