-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (31 loc) · 887 Bytes
/
Makefile
File metadata and controls
51 lines (31 loc) · 887 Bytes
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
#
# Ultility Makefile to build/push Docker images
#
VERSION := 0.2
USER := timeloopaccelergy
REPO := tutorial
NAME := ${USER}/${REPO}
TAG := $$(git log -1 --pretty=%h)
IMG := ${NAME}:${TAG}
LATEST := ${NAME}:latest
all: build
# Pull all submodules
pull:
git submodule foreach git pull origin master
# Build and tag docker image
build:
"${DOCKER_EXE}" 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_EXE}" tag ${IMG} ${LATEST}
# Push docker image
push:
"${DOCKER_EXE}" push ${NAME}
# Lint the Dockerfile
lint:
"${DOCKER_EXE}" run --rm -i hadolint/hadolint < Dockerfile || true
# Login to docker hub
login:
"${DOCKER_EXE}" login --username ${DOCKER_NAME} --password ${DOCKER_PASS}