Skip to content

Commit e60d6af

Browse files
Produce builds for arm64, drop support form armv7
1 parent 8446851 commit e60d6af

File tree

5 files changed

+30
-18
lines changed

5 files changed

+30
-18
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
~/.cargo/bin
2222
~/.cargo/registry
2323
~/.cargo/git
24-
target
2524
key: build-${{ runner.os }}-cargo-any
2625

2726
- name: Install Rust toolchain
@@ -96,10 +95,19 @@ jobs:
9695
username: ${{ secrets.DOCKERHUB_USERNAME }}
9796
password: ${{ secrets.DOCKERHUB_TOKEN }}
9897

98+
- name: Set up QEMU
99+
uses: docker/setup-qemu-action@v3
100+
101+
- name: Set up Docker Buildx
102+
uses: docker/setup-buildx-action@v3
103+
99104
- name: Build and push Docker image
100-
uses: docker/build-push-action@v3
105+
uses: docker/build-push-action@v6
101106
with:
102107
context: .
103108
tags: ${{ steps.metadata.outputs.tags }}
104109
labels: ${{ steps.metadata.outputs.labels }}
105110
push: true
111+
platforms: |
112+
linux/amd64
113+
linux/arm64

Dockerfile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
FROM rustlang/rust:nightly-trixie AS build
1+
FROM rust:latest AS build
2+
3+
ARG TARGETPLATFORM
4+
5+
WORKDIR /app
6+
COPY . /app
7+
8+
RUN case ${TARGETPLATFORM} in \
9+
"linux/amd64") echo "x86_64-unknown-linux-musl" > .toolchain ;; \
10+
"linux/arm64") echo "aarch64-unknown-linux-musl" > .toolchain ;; \
11+
*) echo "Unsupported platform: $TARGETPLATFORM" && exit 1 ;; \
12+
esac
213

314
RUN apt-get update
415
RUN apt-get install -y musl-tools
516

6-
RUN rustup --version
7-
RUN rustup target add x86_64-unknown-linux-musl
8-
9-
RUN rustc --version && \
10-
rustup --version && \
11-
cargo --version
17+
RUN rustup target add $(cat .toolchain)
1218

13-
WORKDIR /app
14-
COPY . /app
15-
RUN cargo clean && cargo build --release --target x86_64-unknown-linux-musl
16-
RUN strip ./target/x86_64-unknown-linux-musl/release/vigil
19+
RUN cargo build --release --target $(cat .toolchain)
20+
RUN mv ./target/$(cat .toolchain)/release/vigil ./
1721

1822
FROM alpine:latest
1923

2024
WORKDIR /usr/src/vigil
2125

2226
COPY ./res/assets/ ./res/assets/
2327
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
24-
COPY --from=build /app/target/x86_64-unknown-linux-musl/release/vigil /usr/local/bin/vigil
28+
COPY --from=build /app/vigil /usr/local/bin/vigil
2529

2630
CMD [ "vigil", "-c", "/etc/vigil.cfg" ]
2731

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Vigil is an open-source Status Page you can host on your infrastructure, used to
99

1010
It is useful in microservices contexts to monitor both apps and backends. If a node goes down in your infrastructure, you receive a status change notification in a Slack channel, Email, Twilio SMS or/and XMPP.
1111

12-
_Tested at Rust version: `rustc 1.90.0 (1159e78c4 2025-09-14)`_
12+
_Tested at Rust version: `rustc 1.91.1 (ed61e7d7e 2025-11-07)`_
1313

1414
**🇭🇺 Crafted in Budapest, Hungary.**
1515

scripts/release_binaries.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fi
3838
function release_for_architecture {
3939
final_tar="v$VIGIL_VERSION-$1.tar.gz"
4040

41-
rm -rf ./vigil/ && \
41+
rm -rf ./vigil/ ./target/ && \
4242
cross build --target "$2" --release && \
4343
mkdir ./vigil && \
4444
cp -p "target/$2/release/vigil" ./vigil/ && \
@@ -64,7 +64,7 @@ pushd "$BASE_DIR" > /dev/null
6464
echo "Executing release steps for Vigil v$VIGIL_VERSION..."
6565

6666
release_for_architecture "x86_64" "x86_64-unknown-linux-musl" && \
67-
release_for_architecture "armv7" "armv7-unknown-linux-musleabihf"
67+
release_for_architecture "aarch64" "aarch64-unknown-linux-musl"
6868
rc=$?
6969

7070
if [ $rc -eq 0 ]; then

scripts/sign_binaries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pushd "$BASE_DIR" > /dev/null
5959
echo "Executing sign steps for Vigil v$VIGIL_VERSION..."
6060

6161
sign_for_architecture "x86_64" && \
62-
sign_for_architecture "armv7"
62+
sign_for_architecture "aarch64"
6363
rc=$?
6464

6565
if [ $rc -eq 0 ]; then

0 commit comments

Comments
 (0)