forked from blacktop/docker-elastic-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (21 loc) · 868 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
REPO=blacktop
NAME=elastic-stack
BUILD ?= 5.1
LATEST ?= 5.1
all: build size test
build:
cd $(BUILD); docker build -t $(REPO)/$(NAME):$(BUILD) .
size: build
ifeq "$(BUILD)" "$(LATEST)"
sed -i.bu 's/docker image-.*-blue/docker image-$(shell docker images --format "{{.Size}}" $(REPO)/$(NAME):$(BUILD))-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 etest $(REPO)/$(NAME):$(BUILD); sleep 10;
docker logs etest
docker exec etest head -n100 /var/log/elasticsearch.stdout.log
docker rm -f etest
.PHONY: build size tags test