-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
57 lines (50 loc) · 2.21 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
################################################################################
# @brief: Top-level build script.
# @copyright: Matthew Giassa, Dimitar Tomov, 2021.
# @author: Matthew Giassa.
# @author: Dimitar Tomov.
# @email: [email protected]
# @license: MIT license with conditions for ownership:
# This project and its associated files come with no warranty,
# implied or otherwise, even for fitness for a particular
# purpose. All derivative works must include the above notice in
# source form, and in customer-facing "README" and/or "about
# menu" logic to attribute ownership and acknowledgement to
# author(s) to end users, customers, evaluators, etc.
################################################################################
################################################################################
# Globals.
################################################################################
# TODO: this should come from an external CI-related file like for GitHub or
# GitLab, etc.
DOCKER_TAG=0.0.3
DOCKER_IMAGE=iax-tpm-runtime
DOCKER_REPO=iaxes
################################################################################
# Build goals/recipes/targets.
################################################################################
#------------------------------------------------------------------------------#
# Set default target.
.DEFAULT_GOAL: all
#------------------------------------------------------------------------------#
# Top-level goal.
.PHONY: all
all:
# Build Docker image. Use DOCKER_BUILDKIT so we can bundle Dockerfiles
# and their associated "dockerignore" files (plus some additional
# helpful features for developers).
DOCKER_BUILDKIT=1 docker build . \
-f ./Dockerfile.release \
--target=baseline \
--tag=$(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG)
#------------------------------------------------------------------------------#
.PHONY: publish
publish:
# Push the image to Dockerhub for long-term artifact storage.
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG)
# Tag "latest".
docker tag \
$(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) \
$(DOCKER_REPO)/$(DOCKER_IMAGE):latest
# Push "latest".
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest