FROM rust:1.70.0-slim AS builder FROM alpine:latest # we could also RUN 'apk add ca-certificates', but we prefer to be consistent with the -minimal image COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # run as user for security RUN mkdir /unftp && mkdir -p /srv RUN addgroup -g 1010 unftp \ && adduser -D -s /bin/sh -u 1010 -G unftp unftp \ && chown -R unftp:unftp /unftp /srv COPY --chown=unftp:unftp --chmod=755 ./x86_64-unknown-linux-musl/unftp_x86_64-unknown-linux-musl /unftp/unftp VOLUME /srv WORKDIR /unftp USER unftp CMD ["/unftp/unftp", "-vv"]