2021-11-29 18:06:55 +00:00
|
|
|
ARG BUILD_TAG=1.56.1
|
2021-06-21 20:38:36 +00:00
|
|
|
ARG RUN_TAG=$BUILD_TAG
|
|
|
|
|
|
|
|
FROM rust:$BUILD_TAG as builder
|
2019-03-31 03:03:46 +00:00
|
|
|
|
2019-04-12 00:07:59 +00:00
|
|
|
WORKDIR /usr/src/
|
2021-05-07 19:55:29 +00:00
|
|
|
RUN USER=root cargo new --bin vaultwarden_ldap
|
|
|
|
WORKDIR /usr/src/vaultwarden_ldap
|
2019-03-31 03:03:46 +00:00
|
|
|
|
2019-04-12 00:07:59 +00:00
|
|
|
# Compile dependencies
|
2020-07-09 19:04:05 +00:00
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
RUN cargo build --locked --release
|
2019-04-12 00:07:59 +00:00
|
|
|
|
2020-07-09 19:04:05 +00:00
|
|
|
# Remove bins to make sure we rebuild
|
2021-11-29 18:47:33 +00:00
|
|
|
# hadolint ignore=DL3059
|
2021-05-07 19:55:29 +00:00
|
|
|
RUN rm ./target/release/deps/vaultwarden_ldap*
|
2020-07-09 19:04:05 +00:00
|
|
|
# Copy source and install
|
|
|
|
COPY src ./src
|
2021-06-21 20:38:36 +00:00
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
FROM rust:$RUN_TAG
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /usr/src/vaultwarden_ldap/target/release/vaultwarden_ldap /usr/local/bin/
|
2019-03-31 03:03:46 +00:00
|
|
|
|
2021-06-21 20:38:36 +00:00
|
|
|
CMD ["/usr/local/bin/vaultwarden_ldap"]
|