-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (40 loc) · 1.2 KB
/
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
47
CONTAINER := carbonzipper
IMAGE_NAME := $(CONTAINER)
BUILD_NAME := "$(IMAGE_NAME)-build"
DATA_DIR := $(shell pwd)
DOCKER := docker
build:
if $(DOCKER) ps -a |grep -q $(BUILD_NAME); \
then echo $(BUILD_NAME) exist, skipping; \
else $(DOCKER) run --name $(BUILD_NAME) golang sh -c "CGO_ENABLED=0 GOOS=linux go get -ldflags \"-s\" -a -installsuffix cgo github.com/dgryski/carbonzipper"; \
fi
$(DOCKER) cp $(BUILD_NAME):/go/bin/$(CONTAINER) .
$(DOCKER) \
build \
--rm --tag=$(IMAGE_NAME) .
-rm $(CONTAINER) >/dev/null
run: build
$(DOCKER) \
run \
--rm \
--tty \
--interactive \
--publish=8086:8086\
--hostname=${CONTAINER} \
--name=${CONTAINER} \
--volume=$(shell pwd)/carbonzipper.conf:/carbonzipper.conf \
$(IMAGE_NAME)
stop:
$(DOCKER) \
kill ${CONTAINER}
history:
$(DOCKER) \
history ${IMAGE_NAME}
clean:
-$(DOCKER) rmi --force $(IMAGE_NAME)
-$(DOCKER) rm --force $(BUILD_NAME)
-$(DOCKER) rmi --force $(BUILD_NAME)
-$(DOCKER) rmi --force $(registry)/$(BUILD_NAME)
-$(DOCKER) rmi --force $(registry)/$(IMAGE_NAME)
push:
$(DOCKER) tag $(IMAGE_NAME) jolt/$(IMAGE_NAME):master && $(DOCKER) tag $(IMAGE_NAME) jolt/$(IMAGE_NAME):latest && $(DOCKER) push jolt/$(IMAGE_NAME)