From 776440654b93efd0fbd4a2dfdf72007f72259ebd Mon Sep 17 00:00:00 2001 From: Benjamin Bohard Date: Thu, 6 May 2021 10:47:35 +0200 Subject: [PATCH] Adaptation du patch pour compiler sur Ubuntu 18.04 --- patch/amd64/Dockerfile.patch | 38 +++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/patch/amd64/Dockerfile.patch b/patch/amd64/Dockerfile.patch index 0f7cfd2..4fb1850 100644 --- a/patch/amd64/Dockerfile.patch +++ b/patch/amd64/Dockerfile.patch @@ -1,6 +1,34 @@ ---- git/docker/amd64/Dockerfile 2021-02-12 11:45:13.762372371 +0100 -+++ Dockerfile 2021-02-12 11:59:56.727518522 +0100 -@@ -111,3 +111,23 @@ +diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile +index 5d8deb4..705c864 100644 +@@ -25,7 +25,7 @@ + FROM bitwardenrs/web-vault@sha256:345a509dd5482343458b672dcd69203836ffac2e5181a1c99826d9695b9cb1eb as vault + + ########################## BUILD IMAGE ########################## +-FROM rust:1.48 as build ++FROM buildpack-deps:bionic as build + + # Debian-based builds support multidb + ARG DB=sqlite,mysql,postgresql +@@ -33,6 +33,9 @@ ARG DB=sqlite,mysql,postgresql + # Build time options to avoid dpkg warnings and help with reproducible builds. + ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color + ++RUN apt update && apt install -y curl build-essential libssl-dev openssl ++RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ++ENV PATH="/root/.cargo/bin:${PATH}" + # Don't download rust docs + RUN rustup set profile minimal + +@@ -73,7 +76,7 @@ RUN cargo build --features ${DB} --release + ######################## RUNTIME IMAGE ######################## + # Create a new stage with a minimal image + # because we already have a binary built +-FROM debian:buster-slim ++FROM ubuntu:18.04 + + ENV ROCKET_ENV "staging" + ENV ROCKET_PORT=80 +@@ -111,3 +114,23 @@ HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] WORKDIR / ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["/start.sh"] @@ -9,7 +37,7 @@ +FROM build as dpkg +RUN mkdir -p /bitwarden_package/DEBIAN +RUN mkdir -p /bitwarden_package/usr/local/bin -+RUN mkdir -p /bitwarden_package/usr/lib/systemd/system ++RUN mkdir -p /bitwarden_package/lib/systemd/system +RUN mkdir -p /bitwarden_package/etc/bitwarden_rs +RUN mkdir -p /bitwarden_package/usr/share/bitwarden_rs + @@ -19,7 +47,7 @@ +COPY debian/conffiles /bitwarden_package/DEBIAN/conffiles +COPY Rocket.toml /bitwarden_package/etc/bitwarden_rs +COPY debian/config.env /bitwarden_package/etc/bitwarden_rs -+COPY debian/bitwarden_rs.service /bitwarden_package/usr/lib/systemd/system ++COPY debian/bitwarden_rs.service /bitwarden_package/lib/systemd/system +COPY --from=vault /web-vault /bitwarden_package/usr/share/bitwarden_rs/web-vault +COPY --from=build app/target/release/bitwarden_rs /bitwarden_package/usr/local/bin +