Support for arm32v7 (#25)
* Move Dockerfile.patch files to architecture dependent directories Need a way to distinguish between patches when we implement support for other architectures. Putting them in different paths seems simple and straight forward enough. * Add -a option to support arm32v7 and amd64 architectures Previous releases lacked support for compiling for arm32v7 architecture. In order to keep previous behaviour the default is set to amd64. Using the -a option, users can now choose between arm32v7 and amd64. If arm32v7 is used only the Buster release of debian is supported. The limitation is due to the libmariadb3:armhf dependency not being avaliable in earlier debian releases. * Update documentation to detail the -a option * Remove reference to local dirs * Set debian package to report correct architecture for arm32v7 build * Format arm32v7 Dockerfile.patch to match the amd64 * Handle architecture property in control file dynamically Similar to version, the architecture property in the control file should be handled dynamically. The build script will now replace the architecture prop from control.dist to match the choosen architecture.
This commit is contained in:
committed by
GitHub
parent
9d735d0a99
commit
9989534983
98
patch/amd64/Dockerfile.patch
Normal file
98
patch/amd64/Dockerfile.patch
Normal file
@ -0,0 +1,98 @@
|
||||
--- ./git/docker/amd64/Dockerfile 2020-10-11 13:07:49.749465588 +0200
|
||||
+++ ./Dockerfile 2020-10-11 14:00:43.341362012 +0200
|
||||
@@ -34,72 +34,68 @@
|
||||
--no-install-recommends \
|
||||
libmariadb-dev \
|
||||
libpq-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Creates a dummy project used to grab dependencies
|
||||
RUN USER=root cargo new --bin /app
|
||||
WORKDIR /app
|
||||
|
||||
# Copies over *only* your manifests and build files
|
||||
-COPY ./Cargo.* ./
|
||||
-COPY ./rust-toolchain ./rust-toolchain
|
||||
-COPY ./build.rs ./build.rs
|
||||
+COPY git/Cargo.* ./
|
||||
+COPY git/rust-toolchain ./rust-toolchain
|
||||
+COPY git/build.rs ./build.rs
|
||||
|
||||
|
||||
# Builds your dependencies and removes the
|
||||
# dummy project, except the target folder
|
||||
# This folder contains the compiled dependencies
|
||||
RUN cargo build --features ${DB} --release
|
||||
RUN find . -not -path "./target*" -delete
|
||||
|
||||
# Copies the complete project
|
||||
# To avoid copying unneeded files, use .dockerignore
|
||||
-COPY . .
|
||||
+COPY git .
|
||||
|
||||
# Make sure that we actually build the project
|
||||
RUN touch src/main.rs
|
||||
|
||||
# Builds again, this time it'll just be
|
||||
# your actual source files being built
|
||||
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
|
||||
|
||||
-ENV ROCKET_ENV "staging"
|
||||
-ENV ROCKET_PORT=80
|
||||
-ENV ROCKET_WORKERS=10
|
||||
-
|
||||
# Install needed libraries
|
||||
RUN apt-get update && apt-get install -y \
|
||||
--no-install-recommends \
|
||||
openssl \
|
||||
ca-certificates \
|
||||
curl \
|
||||
sqlite3 \
|
||||
libmariadb-dev-compat \
|
||||
libpq5 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
-RUN mkdir /data
|
||||
-VOLUME /data
|
||||
-EXPOSE 80
|
||||
-EXPOSE 3012
|
||||
-
|
||||
-# Copies the files from the context (Rocket.toml file and web-vault)
|
||||
-# and the binary from the "build" stage to the current stage
|
||||
-COPY Rocket.toml .
|
||||
-COPY --from=vault /web-vault ./web-vault
|
||||
-COPY --from=build app/target/release/bitwarden_rs .
|
||||
-
|
||||
-COPY docker/healthcheck.sh /healthcheck.sh
|
||||
-COPY docker/start.sh /start.sh
|
||||
-
|
||||
-HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"]
|
||||
-
|
||||
-# Configures the startup!
|
||||
-WORKDIR /
|
||||
-CMD ["/start.sh"]
|
||||
+# Create package directory
|
||||
+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/etc/bitwarden_rs
|
||||
+RUN mkdir -p /bitwarden_package/usr/share/bitwarden_rs
|
||||
+
|
||||
+WORKDIR /bitwarden_package
|
||||
+
|
||||
+COPY debian/control /bitwarden_package/DEBIAN/control
|
||||
+COPY debian/postinst /bitwarden_package/DEBIAN/postinst
|
||||
+COPY debian/conffiles /bitwarden_package/DEBIAN/conffiles
|
||||
+COPY git/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 --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
|
||||
|
||||
+# Create the package
|
||||
+RUN dpkg-deb --build . bitwarden-rs.deb
|
Reference in New Issue
Block a user