mirror of
https://github.com/ViViDboarder/bitwarden_rs_ldap.git
synced 2024-11-24 20:26:27 +00:00
5238bc1b60
Using an intermediate image for building. Could possibly slim further by making the `RUN_TAG` a slim variant
25 lines
585 B
Docker
25 lines
585 B
Docker
ARG BUILD_TAG=1.46
|
|
ARG RUN_TAG=$BUILD_TAG
|
|
|
|
FROM rust:$BUILD_TAG as builder
|
|
|
|
WORKDIR /usr/src/
|
|
RUN USER=root cargo new --bin vaultwarden_ldap
|
|
WORKDIR /usr/src/vaultwarden_ldap
|
|
|
|
# Compile dependencies
|
|
COPY Cargo.toml Cargo.lock ./
|
|
RUN cargo build --locked --release
|
|
|
|
# Remove bins to make sure we rebuild
|
|
RUN rm ./target/release/deps/vaultwarden_ldap*
|
|
# Copy source and install
|
|
COPY src ./src
|
|
RUN cargo build --release
|
|
|
|
FROM rust:$RUN_TAG
|
|
WORKDIR /app
|
|
COPY --from=builder /usr/src/vaultwarden_ldap/target/release/vaultwarden_ldap /usr/local/bin/
|
|
|
|
CMD ["/usr/local/bin/vaultwarden_ldap"]
|