-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
49 lines (42 loc) · 1.06 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
prog := python-enclave
version := $(shell git describe --tag --dirty)
image_tag := $(prog):$(version)
image_tar := $(prog)-$(version)-kaniko.tar
image_eif := $(image_tar:%.tar=%.eif)
ARCH ?= $(shell uname -m)
ifeq ($(ARCH),aarch64)
override ARCH=arm64
endif
ifeq ($(ARCH),x86_64)
override ARCH=amd64
endif
.PHONY: all
all: run
.PHONY: image
image: $(image_tar)
$(image_tar): Dockerfile service.py start.sh
docker run \
-v $(PWD):/workspace \
gcr.io/kaniko-project/executor:v1.9.2 \
--reproducible \
--no-push \
--tarPath $(image_tar) \
--destination $(image_tag) \
--build-arg TARGETPLATFORM=linux/$(ARCH) \
--build-arg TARGETOS=linux \
--build-arg TARGETARCH=$(ARCH) \
--custom-platform linux/$(ARCH)
$(image_eif): $(image_tar)
docker load -i $<
nitro-cli build-enclave \
--docker-uri $(image_tag) \
--output-file $(image_eif)
.PHONY: run
run: $(image_eif)
# Terminate already-running enclave.
nitro-cli terminate-enclave --all
# Start our proxy and the enclave.
./run-enclave.sh $(image_eif)
.PHONY: clean
clean:
rm -f $(image_tar) $(image_eif)