diff --git a/src/shadowbox/docker/build.action.sh b/src/shadowbox/docker/build.action.sh index 273737420..4f703f540 100755 --- a/src/shadowbox/docker/build.action.sh +++ b/src/shadowbox/docker/build.action.sh @@ -21,7 +21,16 @@ export DOCKER_BUILDKIT=1 # Newer node images have no valid content trust data. # Pin the image node:16.18.0-alpine3.16 by hash. # See image at https://hub.docker.com/_/node/tags?page=1&name=16.18.0-alpine3.16 -readonly NODE_IMAGE="node@sha256:264861cd2f785a2b727e9f908065e8d9e9358fcc1308da3cb207d9cba69afee2" +readonly NODE_IMAGE=$( + if [[ "$(uname -m)" == "x86_64" ]]; then + echo "node@sha256:264861cd2f785a2b727e9f908065e8d9e9358fcc1308da3cb207d9cba69afee2" + elif [[ "$(uname -m)" == "aarch64" ]]; then + echo "node@sha256:e2aff82eea79469af43ddd121f1c8f8c91a501e838534bd3991e225401b2c38d" + else + echo "Unsupported architecture" + exit 1 + fi +) # Doing an explicit `docker pull` of the container base image to work around an issue where # Travis fails to pull the base image when using BuildKit. Seems to be related to: diff --git a/third_party/outline-ss-server/Makefile b/third_party/outline-ss-server/Makefile index b678c2dc9..4cea3bc89 100644 --- a/third_party/outline-ss-server/Makefile +++ b/third_party/outline-ss-server/Makefile @@ -1,17 +1,23 @@ VERSION=1.4.0 +SHA256_linux_x86_64=f51bcb6391cca0ae828620c429e698a3b7c409de2374c52f113ca9a525e021a8 +SHA256_linux_aarch64=14ae581414c9aab04253a385ef1854c003d09f545f6f8a3a55aa987f0c6d3859 +APP_ARCH_linux_x86_64=x86_64 +APP_ARCH_linux_aarch64=arm64 .PHONY: all all: bin/linux/outline-ss-server bin/macos/outline-ss-server bin/linux/outline-ss-server: OS=linux -bin/linux/outline-ss-server: SHA256=f51bcb6391cca0ae828620c429e698a3b7c409de2374c52f113ca9a525e021a8 +bin/linux/outline-ss-server: SHA256=$(shell echo $(SHA256_linux_$(shell uname -m))) +bin/linux/outline-ss-server: APP_ARCH=$(shell echo $(APP_ARCH_linux_$(shell uname -m))) bin/macos/outline-ss-server: OS=macos bin/macos/outline-ss-server: SHA256=c85b2e8ae2d48482cbc101e54dcb7eed074a22c14a3a7301993e5f786b34081d +bin/macos/outline-ss-server: APP_ARCH=$(APP_ARCH_linux_x86_64) TEMPFILE := $(shell mktemp) bin/%/outline-ss-server: - node ../../src/build/download_file.mjs --url="https://github.com/Jigsaw-Code/outline-ss-server/releases/download/v$(VERSION)/outline-ss-server_$(VERSION)_$(OS)_x86_64.tar.gz" --out="$(TEMPFILE)" --sha256=$(SHA256) + node ../../src/build/download_file.mjs --url="https://github.com/Jigsaw-Code/outline-ss-server/releases/download/v$(VERSION)/outline-ss-server_$(VERSION)_$(OS)_$(APP_ARCH).tar.gz" --out="$(TEMPFILE)" --sha256=$(SHA256) mkdir -p "$(dir $@)" tar -zx -f "$(TEMPFILE)" -C "$(dir $@)" "$(notdir $@)" chmod +x "$@" diff --git a/third_party/prometheus/Makefile b/third_party/prometheus/Makefile index 85221e2be..315a8b557 100644 --- a/third_party/prometheus/Makefile +++ b/third_party/prometheus/Makefile @@ -1,19 +1,26 @@ VERSION=2.37.1 +SHA256_linux_x86_64=753f66437597cf52ada98c2f459aa8c03745475c249c9f2b40ac7b3919131ba6 +SHA256_linux_aarch64=b59a66fb5c7ec5acf6bf426793528a5789a1478a0dad8c64edc2843caf31b1b8 +APP_ARCH_linux_x86_64=amd64 +APP_ARCH_linux_aarch64=arm64 .PHONY: all all: bin/linux/prometheus bin/macos/prometheus bin/linux/prometheus: OS=linux -bin/linux/prometheus: SHA256=753f66437597cf52ada98c2f459aa8c03745475c249c9f2b40ac7b3919131ba6 +bin/linux/prometheus: ARCH=$(shell uname -m) +bin/linux/prometheus: SHA256=$(shell echo $(SHA256_linux_$(ARCH))) +bin/linux/prometheus: APP_ARCH=$(shell echo $(APP_ARCH_linux_$(ARCH))) bin/macos/prometheus: OS=darwin bin/macos/prometheus: SHA256=e03a43d98955ac3500f57353ea74b5df829074205f195ea6b3b88f55c4575c79 +bin/macos/prometheus: APP_ARCH=$(APP_ARCH_linux_x86_64) bin/%/prometheus: TEMPFILE := $(shell mktemp) bin/%/prometheus: - node ../../src/build/download_file.mjs --url="https://github.com/prometheus/prometheus/releases/download/v$(VERSION)/prometheus-$(VERSION).$(OS)-amd64.tar.gz" --out="$(TEMPFILE)" --sha256=$(SHA256) + node ../../src/build/download_file.mjs --url="https://github.com/prometheus/prometheus/releases/download/v$(VERSION)/prometheus-$(VERSION).$(OS)-$(APP_ARCH).tar.gz" --out="$(TEMPFILE)" --sha256=$(SHA256) mkdir -p "$(dir $@)" - tar -zx -f "$(TEMPFILE)" --strip-components=1 -C "$(dir $@)" prometheus-$(VERSION).$(OS)-amd64/prometheus + tar -zx -f "$(TEMPFILE)" --strip-components=1 -C "$(dir $@)" prometheus-$(VERSION).$(OS)-$(APP_ARCH)/prometheus chmod +x "$@" rm -f $(TEMPFILE)