Adaptation du patch pour compiler sur Ubuntu 18.04

This commit is contained in:
Benjamin Bohard 2021-05-06 10:47:35 +02:00
parent 0a9bf0bf57
commit 776440654b
1 changed files with 33 additions and 5 deletions

View File

@ -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
+