forked from blacktop/docker-cuckoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (21 loc) · 853 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
REPO=blacktop
NAME=cuckoo
BUILD ?= 2.0
LATEST ?= 2.0
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)%20MB-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 --rm --name ctest $(REPO)/$(NAME):$(BUILD)
.PHONY: ssh
ssh:
docker run -it --rm --entrypoint=sh $(REPO)/$(NAME):$(BUILD)
.PHONY: build size tags test