Skip to content

Commit

Permalink
Add build for aarch64/arm64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
cleardevice committed Sep 4, 2023
1 parent 2af2011 commit fd4aa51
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
11 changes: 10 additions & 1 deletion src/shadowbox/docker/build.action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 8 additions & 2 deletions third_party/outline-ss-server/Makefile
Original file line number Diff line number Diff line change
@@ -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 "$@"
Expand Down
13 changes: 10 additions & 3 deletions third_party/prometheus/Makefile
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit fd4aa51

Please sign in to comment.