From 39cc420415c0f25b309304f8e26becb754ef09e9 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 29 Jul 2020 20:08:05 +0900 Subject: [PATCH] Improve build time for dockerfiles --- amd64.Dockerfile | 2 +- arm32v7.Dockerfile | 2 +- arm64v8.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amd64.Dockerfile b/amd64.Dockerfile index 0dbff06db..447b606cc 100644 --- a/amd64.Dockerfile +++ b/amd64.Dockerfile @@ -1,6 +1,5 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS builder ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 -ARG CONFIGURATION_NAME=Release WORKDIR /source COPY nuget.config nuget.config COPY Build/Common.csproj Build/Common.csproj @@ -16,6 +15,7 @@ COPY BTCPayServer.Data/. BTCPayServer.Data/. COPY BTCPayServer.Client/. BTCPayServer.Client/. COPY BTCPayServer/. BTCPayServer/. COPY Build/Version.csproj Build/Version.csproj +ARG CONFIGURATION_NAME=Release RUN cd BTCPayServer && dotnet publish --output /app/ --configuration ${CONFIGURATION_NAME} FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.4-buster-slim diff --git a/arm32v7.Dockerfile b/arm32v7.Dockerfile index 1789b7c35..36c78d37d 100644 --- a/arm32v7.Dockerfile +++ b/arm32v7.Dockerfile @@ -1,7 +1,6 @@ # This is a manifest image, will pull the image with the same arch as the builder machine FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS builder ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 -ARG CONFIGURATION_NAME=Release RUN apt-get update \ && apt-get install -qq --no-install-recommends qemu qemu-user-static qemu-user binfmt-support @@ -20,6 +19,7 @@ COPY BTCPayServer.Data/. BTCPayServer.Data/. COPY BTCPayServer.Client/. BTCPayServer.Client/. COPY BTCPayServer/. BTCPayServer/. COPY Build/Version.csproj Build/Version.csproj +ARG CONFIGURATION_NAME=Release RUN cd BTCPayServer && dotnet publish --output /app/ --configuration ${CONFIGURATION_NAME} # Force the builder machine to take make an arm runtime image. This is fine as long as the builder does not run any program diff --git a/arm64v8.Dockerfile b/arm64v8.Dockerfile index a48af6009..e94c31072 100644 --- a/arm64v8.Dockerfile +++ b/arm64v8.Dockerfile @@ -1,7 +1,6 @@ # This is a manifest image, will pull the image with the same arch as the builder machine FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS builder ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 -ARG CONFIGURATION_NAME=Release ENV LC_ALL en_US.UTF-8 RUN apt-get update \ && apt-get install -qq --no-install-recommends qemu qemu-user-static qemu-user binfmt-support @@ -21,6 +20,7 @@ COPY BTCPayServer.Data/. BTCPayServer.Data/. COPY BTCPayServer.Client/. BTCPayServer.Client/. COPY BTCPayServer/. BTCPayServer/. COPY Build/Version.csproj Build/Version.csproj +ARG CONFIGURATION_NAME=Release RUN cd BTCPayServer && dotnet publish --output /app/ --configuration ${CONFIGURATION_NAME} # Force the builder machine to take make an arm runtime image. This is fine as long as the builder does not run any program