2024-10-27 18:43:53 +00:00
|
|
|
FROM docker.io/clux/muslrust:1.82.0-stable@sha256:2db6672beff66b7c64681ac89b5389c34f3eef49b164f689850f2aca4ef0136b AS build
|
2021-05-15 12:19:58 +00:00
|
|
|
|
2021-05-15 13:25:24 +00:00
|
|
|
ARG WEBVAULT_VERSION
|
2023-11-26 10:30:29 +00:00
|
|
|
ARG VAULTWARDEN_VERSION
|
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG LANG=C.UTF-8
|
|
|
|
ARG TZ=UTC
|
|
|
|
ARG RUSTFLAGS="-C link-arg=-s"
|
|
|
|
ARG DB=sqlite,postgresql
|
|
|
|
|
|
|
|
ARG TARGETPLATFORM
|
2020-02-22 15:58:35 +00:00
|
|
|
|
2021-06-18 20:15:42 +00:00
|
|
|
# renovate: datasource=github-releases depName=dani-garcia/bw_web_builds versioning=loose
|
2024-08-12 07:42:50 +00:00
|
|
|
ENV WEBVAULT_VERSION="${WEBVAULT_VERSION:-v2024.6.2}"
|
2023-11-26 10:30:29 +00:00
|
|
|
# renovate: datasource=github-releases depName=dani-garcia/vaultwarden
|
2024-10-27 18:43:43 +00:00
|
|
|
ENV VAULTWARDEN_VERSION="${VAULTWARDEN_VERSION:-1.32.3}"
|
2024-10-06 19:43:04 +00:00
|
|
|
|
|
|
|
ENV DATA_FOLDER=/tmp
|
2020-02-22 15:58:35 +00:00
|
|
|
|
2023-11-26 10:30:29 +00:00
|
|
|
WORKDIR /src
|
2020-02-22 15:58:35 +00:00
|
|
|
|
2023-11-26 10:30:29 +00:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends && \
|
|
|
|
mkdir -p /release/web-vault && \
|
|
|
|
mkdir -p /data
|
|
|
|
|
|
|
|
RUN echo "Using Vaultwarden version '${VAULTWARDEN_VERSION##v}'" && \
|
|
|
|
curl -sSL "https://github.com/dani-garcia/vaultwarden/archive/${VAULTWARDEN_VERSION##v}.tar.gz" | \
|
|
|
|
tar xz --strip-components=1 && \
|
|
|
|
echo "Using Web Vault version '${WEBVAULT_VERSION##v}'" && \
|
2022-06-21 13:15:22 +00:00
|
|
|
curl -SsfL "https://github.com/dani-garcia/bw_web_builds/releases/download/${WEBVAULT_VERSION}/bw_web_${WEBVAULT_VERSION}.tar.gz" | \
|
2023-11-26 10:30:29 +00:00
|
|
|
tar xz -C /release
|
2020-02-22 15:58:35 +00:00
|
|
|
|
2023-11-26 10:30:29 +00:00
|
|
|
RUN echo "Building for platform '$TARGETPLATFORM'" && \
|
|
|
|
case "$TARGETPLATFORM" in \
|
|
|
|
"linux/amd64") echo x86_64-unknown-linux-musl > rust_target ;; \
|
|
|
|
"linux/arm64") echo aarch64-unknown-linux-musl > rust_target ;; \
|
|
|
|
*) exit 1 ;; \
|
|
|
|
esac
|
2020-02-22 15:58:35 +00:00
|
|
|
|
2023-11-26 10:30:29 +00:00
|
|
|
RUN rustup set profile minimal && \
|
|
|
|
rustup target add $(cat rust_target) && \
|
2024-02-12 14:17:41 +00:00
|
|
|
VW_VERSION="${VAULTWARDEN_VERSION##v}" cargo build -j 4 --features "$DB" --target $(cat rust_target) --release
|
2020-02-22 15:58:35 +00:00
|
|
|
|
2023-11-26 10:30:29 +00:00
|
|
|
RUN ldd target/$(cat rust_target)/release/vaultwarden && \
|
|
|
|
target/$(cat rust_target)/release/vaultwarden --help && \
|
|
|
|
target/$(cat rust_target)/release/vaultwarden --version
|
2020-02-22 15:58:35 +00:00
|
|
|
|
2024-09-07 00:06:37 +00:00
|
|
|
FROM docker.io/alpine:3.20@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
|
2023-11-26 10:30:29 +00:00
|
|
|
|
|
|
|
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
|
|
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
2023-12-01 20:54:43 +00:00
|
|
|
LABEL org.opencontainers.image.title="Vaultwarden"
|
2023-11-26 10:30:29 +00:00
|
|
|
LABEL org.opencontainers.image.url="https://gitea.rknet.org/container/vaultwarden"
|
|
|
|
LABEL org.opencontainers.image.source="https://gitea.rknet.org/container/vaultwarden"
|
|
|
|
LABEL org.opencontainers.image.documentation="https://gitea.rknet.org/container/vaultwarden"
|
|
|
|
|
|
|
|
ENV DATA_FOLDER=/data
|
|
|
|
ENV ROCKET_ADDRESS=0.0.0.0
|
|
|
|
ENV ROCKET_PORT=8000
|
|
|
|
ENV WEBSOCKET_ADDRESS=0.0.0.0
|
|
|
|
ENV WEBSOCKET_PORT=3012
|
|
|
|
|
|
|
|
COPY --from=build --chown=65532:65532 /data /data
|
|
|
|
COPY --from=build /release/web-vault /web-vault
|
2023-12-01 20:54:43 +00:00
|
|
|
COPY --from=build /src/target/**/release/vaultwarden /bin/vaultwarden
|
2023-11-26 10:30:29 +00:00
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
EXPOSE 3012
|
2020-02-22 15:58:35 +00:00
|
|
|
|
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
|
2023-12-01 20:54:43 +00:00
|
|
|
USER 65532
|
|
|
|
|
|
|
|
CMD ["/bin/vaultwarden"]
|