FROM --platform=$BUILDPLATFORM ghcr.io/arrow-air/tools/arrow-rust:1.2 AS build ENV CARGO_INCREMENTAL=1 ENV RUSTC_BOOTSTRAP=0 ARG ENABLE_FEATURES= COPY . /usr/src/app RUN apk -U add perl build-base RUN --mount=type=cache,target=/usr/local/cargo/registry \ cd /usr/src/app && \ cargo build --release --features=${ENABLE_FEATURES} FROM --platform=$TARGETPLATFORM alpine:latest ARG PACKAGE_NAME= COPY --from=build /usr/src/app/target/release/${PACKAGE_NAME}-server /usr/local/bin/${PACKAGE_NAME}-server RUN ln -s /usr/local/bin/${PACKAGE_NAME}-server /usr/local/bin/server ENTRYPOINT ["/usr/local/bin/server"]