FROM rust:%%RUST_VERSION%%-slim AS builder WORKDIR /usr/src/unftp COPY . . RUN apt-get update && apt-get install -y \ musl-dev \ musl-tools RUN rustup target add x86_64-unknown-linux-musl ENV RUSTFLAGS="-C target-feature=+crt-static" RUN BUILD_VERSION="%%BUILD_VERSION%%" cargo build --no-default-features --features docker --release --target=x86_64-unknown-linux-musl FROM scratch COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --chown=1010:1010 --from=builder /srv /srv COPY --chown=1010:1010 --from=builder /usr/src/unftp/target/x86_64-unknown-linux-musl/release/unftp /unftp VOLUME /srv USER 1010 CMD ["/unftp", "-vv"]