Update rust to 1.46

Should add support for TLS 1.3

Also, this fixes the Alpine builds
This commit is contained in:
ViViDboarder 2020-09-28 14:58:23 -07:00
parent d19a0efae7
commit b04ee3a60a
4 changed files with 16 additions and 12 deletions

View File

@ -1,4 +1,4 @@
FROM rust:1.33 FROM rust:1.46
WORKDIR /usr/src/ WORKDIR /usr/src/
RUN USER=root cargo new --bin bitwarden_rs_ldap RUN USER=root cargo new --bin bitwarden_rs_ldap

View File

@ -1,18 +1,17 @@
FROM ekidd/rust-musl-builder:1.33.0 AS builder FROM ekidd/rust-musl-builder:1.46.0 AS builder
# Cache build deps
RUN USER=rust cargo init RUN USER=rust cargo init
COPY Cargo.toml Cargo.lock ./
COPY ./Cargo.toml ./Cargo.toml RUN cargo build --locked --release
COPY ./Cargo.lock ./Cargo.lock
RUN cargo build --release
# Remove temp src # Remove temp src
RUN rm src/*.rs RUN rm src/*.rs
COPY ./src ./src # Remove bins to make sure we rebuild
# Fix permissions on source # RUN rm ./target/release/deps/bitwarden_rs_ldap*
RUN USER=root chown -R rust:rust /home/rust/src/src COPY --chown=rust:rust ./src ./src
RUN touch ./src/main.rs RUN touch ./src/main.rs
RUN cargo build --release RUN cargo build --release
FROM alpine:3 FROM alpine:3

View File

@ -52,3 +52,7 @@ clean:
.PHONY: docker-build .PHONY: docker-build
docker-build: docker-build:
docker build -f ./Dockerfile -t $(DOCKER_TAG) . docker build -f ./Dockerfile -t $(DOCKER_TAG) .
.PHONY: docker-build-alpine
docker-build-alpine:
docker build -f ./Dockerfile.alpine -t $(DOCKER_TAG):alpine .

View File

@ -4,11 +4,12 @@ services:
ldap_sync: ldap_sync:
build: build:
context: . context: .
# dockerfile: Dockerfile.alpine dockerfile: Dockerfile.alpine
volumes: volumes:
- ./example.config.toml:/usr/src/bitwarden_rs_ldap/config.toml:ro - ./example.config.toml:/config.toml:ro
# ./root.cert:/usr/src/bitwarden_rs_ldap/root.cert:ro # ./root.cert:/usr/src/bitwarden_rs_ldap/root.cert:ro
environment: environment:
CONFIG_PATH: /config.toml
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
restart: always restart: always