From 36e8341bc452030805fb0fb7585740dfc07fc29c Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:46:40 -0500 Subject: [PATCH] Update MsSqlMigratorUtility Docker file --- util/MsSqlMigratorUtility/Dockerfile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/util/MsSqlMigratorUtility/Dockerfile b/util/MsSqlMigratorUtility/Dockerfile index 561d334088..133beb6fe7 100644 --- a/util/MsSqlMigratorUtility/Dockerfile +++ b/util/MsSqlMigratorUtility/Dockerfile @@ -1,6 +1,8 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 +############################################### +# Build stage # +############################################### -LABEL com.bitwarden.product="bitwarden" +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS bitwarden-build # Copy csproj files as distinct layers WORKDIR /source @@ -20,4 +22,15 @@ RUN dotnet publish -c release -o /app/MsSqlMigratorUtility --no-restore --no-sel WORKDIR /app +############################################### +# App stage # +############################################### +FROM mcr.microsoft.com/dotnet/aspnet:6.0 + +LABEL com.bitwarden.product="bitwarden" + +# Copy app from the build stage +WORKDIR /app +COPY --from=bitwarden-build /app/MsSqlMigratorUtility ./ + ENTRYPOINT ["sh", "-c", "dotnet /app/MsSqlMigratorUtility.dll \"${MSSQL_CONN_STRING}\" -v ${@}", "--" ]