-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
24 lines (20 loc) · 798 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
TARGET ?= armhf
ARCHS ?= amd64 armhf
BASE_ARCH ?= armhf
build: tmp-$(TARGET)/Dockerfile
docker build --build-arg ARCH=$(TARGET) --no-cache -t meyskens/multiarch-nodejs:$(TARGET)-latest tmp-$(TARGET)
docker run --rm meyskens/multiarch-nodejs:$(TARGET)-latest uname -a
tmp-$(TARGET)/Dockerfile: Dockerfile $(shell find overlay-common overlay-$(TARGET))
rm -rf tmp-$(TARGET)
mkdir tmp-$(TARGET)
cp Dockerfile $@
cp -rf overlay-common tmp-$(TARGET)/
cp -rf overlay-$(TARGET) tmp-$(TARGET)/
for arch in $(ARCHS); do \
if [ "$$arch" != "$(TARGET)" ]; then \
sed -i "/arch=$$arch/d" $@; \
fi; \
done
sed -i '/#[[:space:]]*arch=$(TARGET)/s/^#//' $@
sed -i 's/#[[:space:]]*arch=$(TARGET)//g' $@
cat $@