2020-09-28 21:58:23 +00:00
|
|
|
FROM ekidd/rust-musl-builder:1.46.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
|
2020-09-28 21:58:23 +00:00
|
|
|
COPY 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-06-14 02:50:05 +00:00
|
|
|
RUN touch ./src/main.rs && \
|
|
|
|
cargo build --release
|
2019-04-19 01:13:31 +00:00
|
|
|
|
2020-07-09 19:04:05 +00:00
|
|
|
FROM alpine:3
|
2021-03-02 18:01:57 +00:00
|
|
|
RUN apk --no-cache add ca-certificates=20191127-r5
|
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"]
|