bitwarden_rs_ldap/Dockerfile.alpine
ViViDboarder 91d70e6bb8 Add linting, formatting and other checks
This adds pre-commit hooks installable using the provided Makefile as
well as a new check to validate the version in the Cargo file matches
the git tag. This will be useful as a check before pushing releases.
2020-07-09 12:09:19 -07:00

25 lines
575 B
Docker

FROM ekidd/rust-musl-builder:1.33.0 AS builder
RUN USER=rust cargo init
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
RUN cargo build --release
# Remove temp src
RUN rm src/*.rs
COPY ./src ./src
# Fix permissions on source
RUN USER=root chown -R rust:rust /home/rust/src/src
RUN touch ./src/main.rs
RUN cargo build --release
FROM alpine:3
RUN apk --no-cache add ca-certificates=20191127-r4
COPY --from=builder \
/home/rust/src/target/x86_64-unknown-linux-musl/release/bitwarden_rs_ldap \
/usr/local/bin/
CMD ["/usr/local/bin/bitwarden_rs_ldap"]