File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change
1
+ # # detect ARCH for buildx
2
+ ARCH :=$(shell uname -m)
3
+ export ARCH
4
+ ifeq ($(ARCH ) ,x86_64)
5
+ TARGET :=amd64
6
+ export TARGET
7
+ endif
8
+ ifeq ($(ARCH ) ,arm64)
9
+ TARGET :=arm64
10
+ export TARGET
11
+ endif
12
+
1
13
DOCKER =$(shell which docker)
2
14
export DOCKER
3
15
PWD =$(shell echo `pwd`)
@@ -27,7 +39,7 @@ docker-buildx:## docker buildx build sequence
27
39
@$(DOCKER ) buildx ls
28
40
@$(DOCKER ) buildx create --use --name miniscript-buildx || true
29
41
@$(DOCKER ) buildx build -t miniscript --platform linux/arm64,linux/amd64 .
30
- @$(DOCKER ) buildx build -t miniscript --platform linux/arm64 . --load
42
+ @$(DOCKER ) buildx build -t miniscript --platform linux/$( TARGET ) . --load
31
43
docker-miniscript :docker-build# # docker-miniscript
32
44
@[[ -z " $( shell file ./miniscript | grep inux) " ]] && echo " not linux" && rm ./miniscript || echo " miniscript is built for linux"
33
45
@$(DOCKER ) run --rm -v $(PWD ) :/src --publish 80:8080 miniscript sh -c " make install"
You can’t perform that action at this time.
0 commit comments