31 lines
833 B
Docker
31 lines
833 B
Docker
ARG BUILD_TAG=1.70
|
|
|
|
FROM rust:$BUILD_TAG-alpine as builder
|
|
# hadolint ignore=DL3018
|
|
RUN apk add --no-cache pkgconfig g++ openssl-dev
|
|
|
|
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
|
|
# hadolint ignore=DL3059
|
|
RUN rm ./target/release/deps/vaultwarden_ldap*
|
|
# Copy source and install
|
|
COPY src ./src
|
|
ENV PKG_CONFIG_ALLOW_CROSS=1
|
|
ENV OPENSSL_INCLUDE_DIR="/usr/include/openssl"
|
|
RUN cargo install --path .
|
|
|
|
# FROM alpine:3
|
|
# hadolint ignore=DL3018
|
|
# RUN apk --no-cache add ca-certificates openssl
|
|
# COPY --from=builder /usr/local/cargo/bin/vaultwarden_ldap /usr/local/bin/
|
|
|
|
CMD ["/usr/local/cargo/bin/vaultwarden_ldap"]
|
|
# CMD ["/usr/local/bin/vaultwarden_ldap"]
|