mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
* testing-wolfi * testing alpine * fix gosu download * fix Admin dockerfile * update dockerfiles * alpine-compatible-entrypoint-script-for-api-test * make-entrypoint-scripts-alpine-compatible * testing nginx with alpine * cleaning up comments from dockerfile from testing * restore accidentally deleted icon * remove unused file * pin alpine, update apk add no cache * remove comments from testing * test shadow implementtaion for entrypoints * add shadow package, revert entrypoints, change from bash to shell for entry * add icu to setup container, update helpers to use shell * update migrator utility * add missing krb5 libraries
56 lines
1.6 KiB
Docker
56 lines
1.6 KiB
Docker
###############################################
|
|
# Build stage #
|
|
###############################################
|
|
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.21 AS build
|
|
|
|
# Docker buildx supplies the value for this arg
|
|
ARG TARGETPLATFORM
|
|
|
|
# Determine proper runtime value for .NET
|
|
# We put the value in a file to be read by later layers.
|
|
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
|
RID=linux-musl-x64 ; \
|
|
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
|
|
RID=linux-musl-arm64 ; \
|
|
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
|
|
RID=linux-musl-arm ; \
|
|
fi \
|
|
&& echo "RID=$RID" > /tmp/rid.txt
|
|
|
|
# Copy required project files
|
|
WORKDIR /source
|
|
COPY . ./
|
|
|
|
# Restore project dependencies and tools
|
|
WORKDIR /source/util/MsSqlMigratorUtility
|
|
RUN . /tmp/rid.txt && dotnet restore -r $RID
|
|
|
|
# Build project
|
|
WORKDIR /source/util/MsSqlMigratorUtility
|
|
RUN . /tmp/rid.txt && dotnet publish \
|
|
-c release \
|
|
--no-restore \
|
|
--self-contained \
|
|
/p:PublishSingleFile=true \
|
|
-r $RID \
|
|
-o out
|
|
|
|
###############################################
|
|
# App stage #
|
|
###############################################
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.21 AS app
|
|
|
|
ARG TARGETPLATFORM
|
|
LABEL com.bitwarden.product="bitwarden"
|
|
|
|
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
|
|
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
|
|
|
# Copy app from the build stage
|
|
WORKDIR /app
|
|
COPY --from=build /source/util/MsSqlMigratorUtility/out /app
|
|
|
|
RUN apk add --no-cache icu-libs
|
|
|
|
ENTRYPOINT ["sh", "-c", "/app/MsSqlMigratorUtility \"${MSSQL_CONN_STRING}\" ${@}", "--" ]
|