This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 261
/
Copy pathMakefile
61 lines (48 loc) · 2.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This makefile should be used to generate Dockerfiles for all prebuilt images. Prebuilt images are
# located in images/*. These files are then pulled by Docker Hub to generate the public Docker Hub
# images of Graphene and cannot be generated by Docker Hub, since it does not execute commands. When
# GSC changes substantially in its initial Graphene build (e.g. when
# template/Dockerfile.*.compile.template changes), these automatically generated files need to be
# updated. Generally, changes to Graphene do not require rebuilding these Docker files.
IMAGES=aks
VERSIONS=latest
# Official Docker Hub organization name. In case of a name change in Docker Hub, this name as to be
# changed.
DOCKERHUB_ORGANIZATION=graphenelibos
all: generate-dockerfiles build-images
config.aks.%.yaml:
printf \
"Distro: \"ubuntu18.04\"\n\
Graphene:\n\
Repository: \"https://github.com/oscarlab/graphene.git\"\n\
Branch: \"$*\"\n\
SGXDriver:\n\
Repository: \"https://github.com/intel/SGXDataCenterAttestationPrimitives.git\"\n\
Branch: \"DCAP_1.7 && cp -r driver/linux/* .\"\n" > $@
images/graphene_aks.latest.dockerfile: config.aks.master.yaml
./gsc build-graphene -f -c $< graphene-aks
mv graphene-aks/Dockerfile.compile $@
$(RM) -r graphene-aks
images:
mkdir -p images
.PHONY: generate-dockerfiles
generate-dockerfiles: images $(addsuffix .dockerfile, $(addprefix $(addprefix images/, graphene_${IMAGES}), .${VERSIONS}))
.PHONY: build-images
build-images: $(addprefix $(addprefix build-, $(IMAGES))-, $(VERSIONS))
.PHONY: build-aks-%
build-aks-%: images/graphene_aks.%.dockerfile
docker build --rm --no-cache -t $(DOCKERHUB_ORGANIZATION)/aks:$* -f images/graphene_aks.$*.dockerfile images/
.PHONY: push-images
push-images: $(addprefix $(addprefix push-, $(IMAGES))-, $(VERSIONS))
.PHONY: push-aks-%
push-aks-%:
docker push $(DOCKERHUB_ORGANIZATION)/aks:$*
.PHONY: distclean
distclean: clean clean-images
$(RM) -r images/
.PHONY: clean
clean:
$(RM) config.aks.*.yaml
.PHONY: clean-images
clean-images:
docker rmi -f $(addprefix $(addprefix $(DOCKERHUB_ORGANIZATION)/, $(IMAGES)):, $(VERSIONS))