2024-08-01 17:54:52 +00:00
|
|
|
FROM rust:1.80 as builder
|
2019-03-30 20:03:46 -07:00
|
|
|
|
2019-04-11 17:07:59 -07:00
|
|
|
WORKDIR /usr/src/
|
2021-05-07 12:55:29 -07:00
|
|
|
RUN USER=root cargo new --bin vaultwarden_ldap
|
|
|
|
WORKDIR /usr/src/vaultwarden_ldap
|
2019-03-30 20:03:46 -07:00
|
|
|
|
2019-04-11 17:07:59 -07:00
|
|
|
# Compile dependencies
|
2020-07-09 12:04:05 -07:00
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
RUN cargo build --locked --release
|
2019-04-11 17:07:59 -07:00
|
|
|
|
2020-07-09 12:04:05 -07:00
|
|
|
# Remove bins to make sure we rebuild
|
2021-11-29 10:47:33 -08:00
|
|
|
# hadolint ignore=DL3059
|
2021-05-07 12:55:29 -07:00
|
|
|
RUN rm ./target/release/deps/vaultwarden_ldap*
|
2020-07-09 12:04:05 -07:00
|
|
|
# Copy source and install
|
|
|
|
COPY src ./src
|
2021-06-21 13:38:36 -07:00
|
|
|
RUN cargo build --release
|
|
|
|
|
2024-07-12 15:47:00 -07:00
|
|
|
# Use most recent ubuntu LTS release
|
|
|
|
FROM ubuntu:24.04
|
|
|
|
RUN apt-get update \
|
2024-08-04 07:27:11 +02:00
|
|
|
&& apt-get install -y --no-install-recommends ca-certificates 'libssl-dev=3.*' \
|
2024-07-12 15:47:00 -07:00
|
|
|
&& rm -rf /var/cache/apt/lists
|
2021-06-21 13:38:36 -07:00
|
|
|
COPY --from=builder /usr/src/vaultwarden_ldap/target/release/vaultwarden_ldap /usr/local/bin/
|
2019-03-30 20:03:46 -07:00
|
|
|
|
2021-06-21 13:38:36 -07:00
|
|
|
CMD ["/usr/local/bin/vaultwarden_ldap"]
|