forked from blacktop/docker-elasticsearch-alpine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (23 loc) · 1011 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
REPO=blacktop
NAME=elasticsearch
BUILD ?= 5.5
LATEST ?= 5.5
all: build size test
build:
cd $(BUILD); docker build -t $(REPO)/$(NAME):$(BUILD) .
size: build
ifeq "$(BUILD)" "$(LATEST)"
sed -i.bu 's/docker%20image-.*-blue/docker%20image-$(shell docker images --format "{{.Size}}" $(REPO)/$(NAME):$(BUILD)| cut -d' ' -f1)-blue/' README.md
sed -i.bu '/latest/ s/[0-9.]\{3,5\}MB/$(shell docker images --format "{{.Size}}" $(REPO)/$(NAME):$(BUILD))/' README.md
endif
sed -i.bu '/$(BUILD)/ s/[0-9.]\{3,5\}MB/$(shell docker images --format "{{.Size}}" $(REPO)/$(NAME):$(BUILD))/' README.md
tags:
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}" $(REPO)/$(NAME)
test:
docker run -d --name esatest -p 9200:9200 -e cluster.name=testcluster $(REPO)/$(NAME):$(BUILD); sleep 10;
docker logs esatest
http localhost:9200 | jq .cluster_name
docker rm -f esatest
run:
docker run -d --name esrun -p 9200:9200 -e cluster.name=devcluster $(REPO)/$(NAME):$(BUILD)
.PHONY: build size tags test run