-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (35 loc) · 885 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Ultility Makefile to build/push Docker images
#
#
# To use an alternate tag invoke as:
#
# make build ALTTAG=<alternate-tag>
#
VERSION := 0.1
USER := jsemer
REPO := fibertree-notebook
NAME := ${USER}/${REPO}
GITTAG := $$(git log -1 --pretty=%h)
IMG := ${NAME}:${GITTAG}
ALTTAG := latest
ALTIMG := ${NAME}:${ALTTAG}
all: build
# Build and tag docker image
build:
./scripts/update_compiler_repo.sh
docker build ${BUILD_FLAGS} \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=${TAG} \
--build-arg BUILD_VERSION=${VERSION} \
-t ${IMG} .
docker tag ${IMG} ${ALTIMG}
# Push docker image
push:
docker push ${NAME}
# Lint the Dockerfile
lint:
docker run --rm -i hadolint/hadolint < Dockerfile || true
# Login to docker hub
login:
@docker log -u ${DOCKER_USER} -p ${DOCKER_PASS}