-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 949 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
NAME = mczoorouter
REGISTRY ?= docker/$(NAME)
# Get the version from .auroraversion file
#VERSION = $(file < .auroraversion)
VERSION = $(shell git describe --tags --dirty --always)
ifeq ($(VERSION),)
$(error VERSION is not set)
endif
SAFENAME=$(subst /,-,$(NAME))
.PHONY: all
all: build
.PHONY: build
build:
DOCKER_BUILDKIT=1 \
docker build -t $(NAME) -f Dockerfile .
mcrouter: build
docker create --name $(NAME)-build-results $(NAME)
docker cp $(NAME)-build-results:/usr/bin/mcrouter mcrouter
docker rm -f $(NAME)-build-results
tag: build
DOCKER_BUILDKIT=1 \
docker tag $(NAME) $(REGISTRY)
DOCKER_BUILDKIT=1 \
docker tag $(NAME) $(REGISTRY):$(VERSION)
push: tag
DOCKER_BUILDKIT=1 \
docker push $(REGISTRY)
DOCKER_BUILDKIT=1 \
docker push $(REGISTRY):$(VERSION)
tag_latest: build
DOCKER_BUILDKIT=1 \
docker tag $(NAME) $(REGISTRY):latest
push_latest: tag_latest
DOCKER_BUILDKIT=1 \
docker push $(REGISTRY):latest