Robert Kaussow
6702ae020e
All checks were successful
ci/woodpecker/push/build-package Pipeline was successful
ci/woodpecker/tag/build-package Pipeline was successful
ci/woodpecker/push/build-container Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
ci/woodpecker/tag/build-container Pipeline was successful
ci/woodpecker/tag/docs Pipeline was successful
ci/woodpecker/tag/notify Pipeline was successful
While using `scratch` network connections from the container (e.g. to fetch icons) were not working due to missing SSL libraries and maybe other missing OS dependencies to make network connections. Reviewed-on: #146 Co-authored-by: Robert Kaussow <mail@thegeeklab.de> Co-committed-by: Robert Kaussow <mail@thegeeklab.de>
74 lines
2.7 KiB
Docker
74 lines
2.7 KiB
Docker
FROM docker.io/clux/muslrust:1.74.0-stable@sha256:37ba39a117840fd3a75d8be237687c4d69c1d647d75072a17452efd91a67badd as build
|
|
|
|
ARG WEBVAULT_VERSION
|
|
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
|
|
|
|
# renovate: datasource=github-releases depName=dani-garcia/bw_web_builds versioning=loose
|
|
ENV WEBVAULT_VERSION="${WEBVAULT_VERSION:-v2023.10.0}"
|
|
# renovate: datasource=github-releases depName=dani-garcia/vaultwarden
|
|
ENV VAULTWARDEN_VERSION="${VAULTWARDEN_VERSION:-1.30.1}"
|
|
|
|
WORKDIR /src
|
|
|
|
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}'" && \
|
|
curl -SsfL "https://github.com/dani-garcia/bw_web_builds/releases/download/${WEBVAULT_VERSION}/bw_web_${WEBVAULT_VERSION}.tar.gz" | \
|
|
tar xz -C /release
|
|
|
|
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
|
|
|
|
RUN rustup set profile minimal && \
|
|
rustup target add $(cat rust_target) && \
|
|
VW_VERSION="${VAULTWARDEN_VERSION##v}" cargo build -j 8 --features "$DB" --target $(cat rust_target) --release
|
|
|
|
RUN ldd target/$(cat rust_target)/release/vaultwarden && \
|
|
target/$(cat rust_target)/release/vaultwarden --help && \
|
|
target/$(cat rust_target)/release/vaultwarden --version
|
|
|
|
FROM docker.io/alpine:3.18@sha256:34871e7290500828b39e22294660bee86d966bc0017544e848dd9a255cdf59e0
|
|
|
|
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
LABEL org.opencontainers.image.title="Vaultwarden"
|
|
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
|
|
COPY --from=build /src/target/**/release/vaultwarden /bin/vaultwarden
|
|
|
|
EXPOSE 8000
|
|
EXPOSE 3012
|
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
USER 65532
|
|
|
|
CMD ["/bin/vaultwarden"]
|