feat: add multistage release dockerbuilds
Some checks reported errors
continuous-integration/drone/push Build was killed

* this makes the whole thing self-sufficient - i.e. no more reliance on
  host's dotnet, everything is pulled during the build process

* makefile has been updated to reflect this change so that
  the 'dockerbuild' target is no longer dependent on 'releasebuild' target
This commit is contained in:
surtur 2020-11-27 13:27:37 +01:00
parent 4b4e2c881a
commit 2cf282bb51
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,16 @@
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-alpine
COPY . /src
WORKDIR /src
RUN sed -i 's/2.1.519/2.1.811/' global.json
RUN dotnet --version && dotnet --info
RUN dotnet clean
RUN dotnet restore
RUN dotnet build -c Release
FROM mcr.microsoft.com/dotnet/aspnet:2.1
COPY bin/Release/netcoreapp2.1/publish/ App/
COPY --from=0 /src/bin/Release/netcoreapp2.1/publish/ App/
WORKDIR /App
ENV ASPNETCORE_ENVIRONMENT=Release
ENTRYPOINT ["dotnet", "pwt-0x01-ng.dll"]

View File

@ -20,7 +20,7 @@ run:
releasebuild: clean restore
$(CC) publish -c Release
dockerbuild: releasebuild
dockerbuild:
docker build -t $(dtag) -f $(dfile) .
dockerdevbuild: