-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
38 lines (33 loc) · 1.08 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
# Requires DOCKERHUB_ID and VERSION environment variables
ifeq ($(DOCKERHUB_ID),)
ifeq ($(VERSION),)
DAEMON_IMAGE=cni-infoblox-daemon
PLUGIN_IMAGE=cni-infoblox-plugin
else
DAEMON_IMAGE=cni-infoblox-daemon:${VERSION}
PLUGIN_IMAGE=cni-infoblox-plugin:${VERSION}
endif
else
ifeq ($(VERSION),)
DAEMON_IMAGE=${DOCKERHUB_ID}/cni-infoblox-daemon
PLUGIN_IMAGE=${DOCKERHUB_ID}/cni-infoblox-plugin
else
DAEMON_IMAGE=${DOCKERHUB_ID}/cni-infoblox-daemon:${VERSION}
PLUGIN_IMAGE=${DOCKERHUB_ID}/cni-infoblox-plugin:${VERSION}
endif
endif
# Delete local docker images
clean:
docker rmi -f ${DAEMON_IMAGE} || true
docker rmi -f ${PLUGIN_IMAGE} || true
# Ensure go dependencies
deps:
dep ensure
# Build container Images...
build: clean deps
docker build -t $(DAEMON_IMAGE) -f Dockerfile-infoblox-daemon .
docker build -t $(PLUGIN_IMAGE) -f Dockerfile-infoblox-plugin .
# Push image to user's docker hub. NOTE: requires DOCKERHUB_ID environment variable
push: build
docker push $(DAEMON_IMAGE)
docker push $(PLUGIN_IMAGE)