Skip to content

Commit

Permalink
fix(hole-punch): Add support for arm64 architecture (#4687)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos authored Oct 25, 2023
1 parent 06a0acf commit 2c23215
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions hole-punching-tests/Dockerfile
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

0 comments on commit 2c23215

Please sign in to comment.