mirror of
https://github.com/ViViDboarder/bitwarden_rs_ldap.git
synced 2024-11-25 04:36:27 +00:00
Slim final image
Using an intermediate image for building. Could possibly slim further by making the `RUN_TAG` a slim variant
This commit is contained in:
parent
08dcdd2bba
commit
5238bc1b60
13
Dockerfile
13
Dockerfile
@ -1,4 +1,7 @@
|
|||||||
FROM rust:1.46
|
ARG BUILD_TAG=1.46
|
||||||
|
ARG RUN_TAG=$BUILD_TAG
|
||||||
|
|
||||||
|
FROM rust:$BUILD_TAG as builder
|
||||||
|
|
||||||
WORKDIR /usr/src/
|
WORKDIR /usr/src/
|
||||||
RUN USER=root cargo new --bin vaultwarden_ldap
|
RUN USER=root cargo new --bin vaultwarden_ldap
|
||||||
@ -12,6 +15,10 @@ RUN cargo build --locked --release
|
|||||||
RUN rm ./target/release/deps/vaultwarden_ldap*
|
RUN rm ./target/release/deps/vaultwarden_ldap*
|
||||||
# Copy source and install
|
# Copy source and install
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN cargo install --path .
|
RUN cargo build --release
|
||||||
|
|
||||||
CMD ["vaultwarden_ldap"]
|
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"]
|
||||||
|
@ -4,7 +4,7 @@ services:
|
|||||||
ldap_sync:
|
ldap_sync:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile.alpine
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- ./example.config.toml:/config.toml:ro
|
- ./example.config.toml:/config.toml:ro
|
||||||
# ./root.cert:/usr/src/vaultwarden_ldap/root.cert:ro
|
# ./root.cert:/usr/src/vaultwarden_ldap/root.cert:ro
|
||||||
|
Loading…
Reference in New Issue
Block a user