-
Notifications
You must be signed in to change notification settings - Fork 53
/
Makefile.docker
37 lines (25 loc) · 1.03 KB
/
Makefile.docker
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
REPO_VERSION=$(shell git describe --abbrev=0 --tag)
IMAGE_VERSION=$(REPO_VERSION)
DOCKER_FILE?=./
NETWORK_NAME?=host
REGISTRY=tonimoreno
DATE=$(shell date +%Y%m%d%H%M%S )
.PHONY: all clean-image clean build-image build push force-build-image force-build run
all: build
clean-image:
docker rmi $(REGISTRY)/snmpcollector:$(REPO_VERSION)
clean: clean-image
build-image:
docker build -t $(REGISTRY)/snmpcollector:$(IMAGE_VERSION) $(DOCKER_FILE)
docker build -t $(REGISTRY)/snmpcollector:latest $(DOCKER_FILE)
build: build-image
push:
docker push $(REGISTRY)/snmpcollector:$(IMAGE_VERSION)
docker push $(REGISTRY)/snmpcollector:latest
force-build-image:
docker rmi -f $(REGISTRY)/snmpcollector:$(IMAGE_VERSION)
docker rmi -f $(REGISTRY)/snmpcollector:latest
docker build --no-cache -t $(REGISTRY)/snmpcollector:$(IMAGE_VERSION) $(DOCKER_FILE)
docker build --no-cache -t $(REGISTRY)/snmpcollector:latest $(DOCKER_FILE)
test-image:
docker run -p 8090:8090 -e SNMPCOL_GENERAL_LOG_MODE=console $(REGISTRY)/snmpcollector:$(IMAGE_VERSION)