From 07ee4313f49d826fe216ca17e30c1838cd60c83d Mon Sep 17 00:00:00 2001 From: Muka Schultze Date: Wed, 7 Apr 2021 19:04:08 -0300 Subject: [PATCH] add build mode argument to docerfile builds --- .../Dockerfile | 15 +++++++-------- ServerProject-DONT-IMPORT-INTO-UNITY/Dockerfile | 11 +++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/Dockerfile b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/Dockerfile index 372617c..56e6231 100644 --- a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/Dockerfile +++ b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/Dockerfile @@ -1,16 +1,15 @@ FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS builder -WORKDIR /lrm +WORKDIR /lrm-lb COPY . . -RUN [\ - "dotnet", "publish", \ - "--output", "/build/", \ - "--configuration", "Release",\ - "--no-self-contained", \ - "." ] +ARG BUILD_MODE="Release" +RUN dotnet publish \ + --output /build/ \ + --configuration $BUILD_MODE \ + --no-self-contained . FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine WORKDIR /lrm-lb COPY --from=builder /build/ . ENV LRM_LB_CONFIG_PATH="/config/config-load-balancer.json" CMD [ "./LRM_LoadBalancer" ] -ENTRYPOINT [ "./LRM_LoadBalancer" ] \ No newline at end of file +ENTRYPOINT [ "./LRM_LoadBalancer"] \ No newline at end of file diff --git a/ServerProject-DONT-IMPORT-INTO-UNITY/Dockerfile b/ServerProject-DONT-IMPORT-INTO-UNITY/Dockerfile index 96f3186..0cf2e8b 100644 --- a/ServerProject-DONT-IMPORT-INTO-UNITY/Dockerfile +++ b/ServerProject-DONT-IMPORT-INTO-UNITY/Dockerfile @@ -1,12 +1,11 @@ FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS builder WORKDIR /lrm COPY . . -RUN [\ - "dotnet", "publish", \ - "--output", "/build/", \ - "--configuration", "Release",\ - "--no-self-contained", \ - "." ] +ARG BUILD_MODE="Release" +RUN dotnet publish \ + --output /build/ \ + --configuration $BUILD_MODE \ + --no-self-contained . FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine WORKDIR /lrm