forked from ao-space/space-single
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (30 loc) · 859 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
build:
@ARCH=$(shell uname -m); \
max_attempts=3; \
count=0; \
until [ $$count -ge $$max_attempts ]; do \
((count++)); \
echo "Attempt $$count of $$max_attempts..."; \
if [ "$$ARCH" = "riscv64" ]; then \
echo "Building for RISC-V using Dockerfile.riscv..."; \
sudo DOCKER_BUILDKIT=0 docker build -f Dockerfile.riscv -t space-single:v1.0.0 ./; \
else \
echo "Building for default architecture..."; \
sudo DOCKER_BUILDKIT=0 docker build -t space-single:v1.0.0 ./; \
fi; \
if [ $$? -eq 0 ]; then \
echo "Build succeeded."; \
break; \
fi; \
if [ $$count -eq $$max_attempts ]; then \
echo "Build failed after $$count attempts."; \
exit 1; \
fi; \
echo "Build failed. Retrying..."; \
done
run:
sudo docker-compose up
stop:
sudo docker-compose stop
remove:
sudo docker-compose down