Files
irtt-rs/Dockerfile
T
renovate Bot b9cc3e2779
Rust CI / cargo fmt (pull_request) Successful in 12s
Rust CI / cargo clippy (pull_request) Successful in 24s
Rust CI / cargo check (x86_64-unknown-linux-gnu) (pull_request) Successful in 22s
Rust CI / cargo check (x86_64-unknown-linux-musl) (pull_request) Failing after 8s
Rust CI / cargo test (x86_64-unknown-linux-musl) (pull_request) Failing after 8s
Rust CI / cargo doc (pull_request) Successful in 23s
Rust CI / cargo test (x86_64-unknown-linux-gnu) (pull_request) Successful in 1m5s
Supply chain / cargo-deny advisories (pull_request) Successful in 6s
Fuzz Smoke / cargo fuzz smoke (pull_request) Failing after 28s
Supply chain / cargo-deny bans licenses sources (pull_request) Successful in 5s
Supply chain / actionlint (pull_request) Successful in 2s
Netem Interop / netem interop (pull_request) Successful in 1m2s
Rust CI / cargo fmt (push) Successful in 18s
Rust CI / cargo check (x86_64-unknown-linux-gnu) (push) Successful in 35s
Rust CI / cargo clippy (push) Successful in 35s
Rust CI / cargo check (x86_64-unknown-linux-musl) (push) Failing after 9s
Rust CI / cargo test (x86_64-unknown-linux-musl) (push) Failing after 8s
Rust CI / cargo test (x86_64-unknown-linux-gnu) (push) Successful in 1m16s
Rust CI / cargo doc (push) Successful in 24s
Fuzz Smoke / cargo fuzz smoke (push) Failing after 27s
Supply chain / cargo-deny advisories (push) Successful in 9s
Supply chain / cargo-deny bans licenses sources (push) Successful in 7s
Supply chain / actionlint (push) Successful in 3s
Netem Interop / netem interop (push) Successful in 1m12s
chore(deps): update rust docker tag to v1.99
2026-10-04 17:02:58 +00:00

43 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1
# Builds the irtt-server applet only, statically linked against musl, and
# ships it in a scratch image with no shell or libc.
#
# Cross-compiles for TARGETPLATFORM using tonistiigi/xx: the builder stage
# always runs natively on BUILDPLATFORM (no QEMU emulation) and xx-cargo
# picks the right musl target triple, sysroot, and linker for whatever
# platform buildx asked for.
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM rust:1.99-alpine AS builder
COPY --from=xx / /
RUN apk add --no-cache clang lld file
ARG TARGETPLATFORM
RUN xx-apk add --no-cache musl-dev
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
RUN xx-cargo build \
--release \
--locked \
-p irtt-rs \
--bin irtt-server \
--no-default-features \
--features server \
--target-dir /build/target \
&& xx-verify /build/target/$(xx-cargo --print-target-triple)/release/irtt-server \
&& cp /build/target/$(xx-cargo --print-target-triple)/release/irtt-server /irtt-server
FROM scratch
COPY --from=builder /irtt-server /irtt-server
ENTRYPOINT ["/irtt-server"]