forked from infobloxopen/cni-infoblox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (33 loc) · 1.09 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=infoblox-cni-daemon
PLUGIN_IMAGE=infoblox-cni-install
else
DAEMON_IMAGE=infoblox-cni-daemon:${VERSION}
PLUGIN_IMAGE=infoblox-cni-install:${VERSION}
endif
else
ifeq ($(VERSION),)
DAEMON_IMAGE=${DOCKERHUB_ID}/infoblox-cni-daemon
PLUGIN_IMAGE=${DOCKERHUB_ID}/infoblox-cni-install
else
DAEMON_IMAGE=${DOCKERHUB_ID}/infoblox-cni-daemon:${VERSION}
PLUGIN_IMAGE=${DOCKERHUB_ID}/infoblox-cni-install:${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-cni-daemon .
docker build -t $(PLUGIN_IMAGE) -f Dockerfile-cni-plugin-installer .
# Push image to user's docker hub. NOTE: requires DOCKERHUB_ID environment variable
push: build
docker push $(DAEMON_IMAGE)
docker push $(PLUGIN_IMAGE)