FROM rust:alpine3.18 ENV RUSTFLAGS="-C target-feature=-crt-static" WORKDIR /usr/src/rebuilderd RUN apk add --no-cache musl-dev openssl-dev pkgconfig COPY . . RUN --mount=type=cache,target=/var/cache/buildkit \ CARGO_HOME=/var/cache/buildkit/cargo \ CARGO_TARGET_DIR=/var/cache/buildkit/alpine/target \ cargo build --release --locked -p rebuilderd-worker && \ cp -v /var/cache/buildkit/alpine/target/release/rebuilderd-worker / FROM alpine:3.18 RUN apk add --no-cache libgcc openssl COPY --from=0 /rebuilderd-worker /usr/local/bin/ ENV REBUILDERD_WORKER_BACKEND=alpine=/usr/local/libexec/rebuilderd/rebuilder-alpine.sh ENTRYPOINT ["rebuilderd-worker"]