FROM rust:1.56-alpine as builder ARG GIT="https://gitlab.com/Mageas/matrix_piped_feed" ARG GIT_BRANCH="master" WORKDIR /usr/src/app RUN apk update && \ apk upgrade && \ apk add --no-cache musl-dev clang-dev openssl-dev git make cmake g++ sqlite-dev sqlite-static RUN git clone "$GIT" --branch "$GIT_BRANCH" . RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo install --path . FROM alpine:3.15.0 RUN apk update && \ apk upgrade && \ apk add --no-cache libstdc++ sqlite-libs su-exec COPY --from=builder /usr/local/cargo/bin/matrix_piped_feed /app/matrix_piped_feed RUN chmod u+x /app/matrix_piped_feed COPY entrypoint.sh /entrypoint.sh RUN chmod u+x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]