forked from wanderer/pwt-0x01-ng
commit 5acb4e2ba773d312c6b5159011ef415af53f8f71 Author: surtur <a_mirre@utb.cz> Date: Tue Jan 26 16:28:10 2021 +0100 chore: rework ci pipeline logic * run {debug,release} builds after clone, then lint Dockerfile{,.dev} and finally run kaniko builds ({debug,release}) in parallel commit 1e16f72eb4957b14c7fb316282d4cefae0811871 Author: surtur <a_mirre@utb.cz> Date: Tue Jan 26 16:19:50 2021 +0100 feat: add hadolint Dockerfile linting to conform the linter and best practices: * add a FROM alias * quote variables (even though they're single-word and known in advance, might actually change it to ignore the warning)
21 lines
470 B
Docker
21 lines
470 B
Docker
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS base
|
|
ENV UID 1000
|
|
ENV GID 1000
|
|
ENV UNAME unpriv
|
|
RUN adduser -D -u ${UID} -g ${GID} -H ${UNAME} -h /src
|
|
WORKDIR /src
|
|
|
|
COPY *.csproj ./
|
|
RUN dotnet restore
|
|
|
|
COPY . ./
|
|
RUN dotnet publish -c Release -o bin/out
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:3.1
|
|
WORKDIR /App
|
|
COPY --from=base /src/bin/out/ .
|
|
RUN chown -R "${UID}":"${GID}" ./
|
|
USER ${UNAME}
|
|
ENV ASPNETCORE_ENVIRONMENT=Release
|
|
ENTRYPOINT ["dotnet", "pwt-0x01-ng.dll"]
|