2023-01-26 00:13:02 +00:00
|
|
|
FROM ekidd/rust-musl-builder:1.57.0 AS builder
|
2019-04-19 01:13:31 +00:00
|
|
|
|
2021-06-14 02:50:05 +00:00
|
|
|
WORKDIR /home/rust/src
|
|
|
|
|
2020-09-28 21:58:23 +00:00
|
|
|
# Cache build deps
|
2019-04-19 01:13:31 +00:00
|
|
|
RUN USER=rust cargo init
|
2021-07-23 22:52:34 +00:00
|
|
|
COPY --chown=rust:rust Cargo.toml Cargo.lock ./
|
2021-06-14 02:50:05 +00:00
|
|
|
RUN cargo build --locked --release && \
|
|
|
|
rm src/*.rs
|
2019-04-19 01:13:31 +00:00
|
|
|
|
2020-09-28 21:58:23 +00:00
|
|
|
COPY --chown=rust:rust ./src ./src
|
2021-07-23 22:52:34 +00:00
|
|
|
RUN USER=rust touch ./src/main.rs
|
|
|
|
# hadolint ignore=DL3059
|
|
|
|
RUN cargo build --release
|
2019-04-19 01:13:31 +00:00
|
|
|
|
2020-07-09 19:04:05 +00:00
|
|
|
FROM alpine:3
|
2023-01-25 23:58:21 +00:00
|
|
|
# hadolint ignore=DL3018
|
|
|
|
RUN apk --no-cache add ca-certificates
|
2019-04-19 01:13:31 +00:00
|
|
|
COPY --from=builder \
|
2021-05-07 19:55:29 +00:00
|
|
|
/home/rust/src/target/x86_64-unknown-linux-musl/release/vaultwarden_ldap \
|
2019-04-19 01:13:31 +00:00
|
|
|
/usr/local/bin/
|
|
|
|
|
2021-05-07 19:55:29 +00:00
|
|
|
CMD ["/usr/local/bin/vaultwarden_ldap"]
|