-
Notifications
You must be signed in to change notification settings - Fork 999
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hole-punch): Add support for arm64 architecture (#4687)
- Loading branch information
1 parent
06a0acf
commit 2c23215
Showing
1 changed file
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
# syntax=docker/dockerfile:1.5-labs | ||
FROM rust:1.73.0 as builder | ||
|
||
RUN rustup target add x86_64-unknown-linux-musl | ||
RUN --mount=type=cache,target=/var/cache/apt apt-get update && apt-get install -y musl-dev musl-tools | ||
|
||
# Run with access to the target cache to speed up builds | ||
WORKDIR /workspace | ||
ADD . . | ||
|
||
# Build the relay as a statically-linked binary. Unfortunately, we must specify the `--target` explicitly. See https://msfjarvis.dev/posts/building-static-rust-binaries-for-linux/. | ||
RUN --mount=type=cache,target=./target \ | ||
--mount=type=cache,target=/usr/local/cargo/registry \ | ||
cargo build --release --package hole-punching-tests --target x86_64-unknown-linux-musl | ||
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --package hole-punching-tests --target $(rustc -vV | grep host | awk '{print $2}') | ||
|
||
RUN --mount=type=cache,target=./target \ | ||
mv ./target/x86_64-unknown-linux-musl/release/hole-punching-tests /usr/local/bin/hole-punching-tests | ||
mv ./target/$(rustc -vV | grep host | awk '{print $2}')/release/hole-punching-tests /usr/local/bin/hole-punching-tests | ||
|
||
FROM alpine:3 | ||
COPY --from=builder /usr/local/bin/hole-punching-tests /usr/bin/hole-punch-client | ||
RUN --mount=type=cache,target=/var/cache/apk apk add bind-tools jq curl tcpdump iproute2-tc | ||
|
||
ENV RUST_BACKTRACE=1 |