From 49840847ff089c3c826876db04b4d624e2f203c6 Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Sat, 6 Jun 2026 00:40:20 +0200 Subject: [PATCH] Added forced output code --- src/LiteCharmsSecurity.Admin.Api/Dockerfile | 7 ++----- src/LiteCharmsSecurity.Admin/Dockerfile | 7 ++----- src/LiteCharmsSecurity.STS.Identity/Dockerfile | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/LiteCharmsSecurity.Admin.Api/Dockerfile b/src/LiteCharmsSecurity.Admin.Api/Dockerfile index bfeb5fa..34afa97 100644 --- a/src/LiteCharmsSecurity.Admin.Api/Dockerfile +++ b/src/LiteCharmsSecurity.Admin.Api/Dockerfile @@ -9,11 +9,8 @@ WORKDIR /app_source COPY . . -RUN --network=host dotnet restore "LiteCharmsSecurity.sln" --verbosity normal > /tmp/restore_error.log 2>&1 || true - -RUN cat /tmp/restore_error.log - -RUN if grep -q "error" /tmp/restore_error.log; then exit 1; fi +RUN --network=host dotnet restore "LiteCharmsSecurity.sln" > /tmp/error.txt 2>&1 || true +RUN export ERR_MSG=$(cat /tmp/error.txt | head -n 5) && false $ERR_MSG WORKDIR "/app_source/src/LiteCharmsSecurity.Admin.Api" RUN dotnet build "LiteCharmsSecurity.Admin.Api.csproj" -c Release -o /app/build diff --git a/src/LiteCharmsSecurity.Admin/Dockerfile b/src/LiteCharmsSecurity.Admin/Dockerfile index ae9b45e..d5790ee 100644 --- a/src/LiteCharmsSecurity.Admin/Dockerfile +++ b/src/LiteCharmsSecurity.Admin/Dockerfile @@ -18,11 +18,8 @@ RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ COPY . . -RUN --network=host dotnet restore "LiteCharmsSecurity.sln" --verbosity normal > /tmp/restore_error.log 2>&1 || true - -RUN cat /tmp/restore_error.log - -RUN if grep -q "error" /tmp/restore_error.log; then exit 1; fi +RUN --network=host dotnet restore "LiteCharmsSecurity.sln" > /tmp/error.txt 2>&1 || true +RUN export ERR_MSG=$(cat /tmp/error.txt | head -n 5) && false $ERR_MSG WORKDIR "/app_source/src/LiteCharmsSecurity.Admin" RUN dotnet build "LiteCharmsSecurity.Admin.csproj" -c Release -o /app/build diff --git a/src/LiteCharmsSecurity.STS.Identity/Dockerfile b/src/LiteCharmsSecurity.STS.Identity/Dockerfile index 79334ba..8f08e67 100644 --- a/src/LiteCharmsSecurity.STS.Identity/Dockerfile +++ b/src/LiteCharmsSecurity.STS.Identity/Dockerfile @@ -9,11 +9,8 @@ WORKDIR /app_source COPY . . -RUN --network=host dotnet restore "LiteCharmsSecurity.sln" --verbosity normal > /tmp/restore_error.log 2>&1 || true - -RUN cat /tmp/restore_error.log - -RUN if grep -q "error" /tmp/restore_error.log; then exit 1; fi +RUN --network=host dotnet restore "LiteCharmsSecurity.sln" > /tmp/error.txt 2>&1 || true +RUN export ERR_MSG=$(cat /tmp/error.txt | head -n 5) && false $ERR_MSG WORKDIR "/app_source/src/LiteCharmsSecurity.STS.Identity" RUN dotnet build "LiteCharmsSecurity.STS.Identity.csproj" -c Release -o /app/build