Skip to content

Commit

Permalink
move to aspnet core images
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlh committed Jul 9, 2018
1 parent e57e2b1 commit f65fc9a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
FROM microsoft/dotnet:2.0-sdk-stretch AS build-env
FROM microsoft/aspnetcore-build:2.0.5-2.1.4 AS build-env

WORKDIR /app

# Copy csproj and restore as distinct layers
COPY ./src/Hamuste.csproj ./
RUN dotnet add package ILLink.Tasks -v 0.1.4-preview-981901 -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json &&\
dotnet restore
RUN dotnet restore

# Copy everything else and build
COPY ./src ./
RUN dotnet publish -c Release -o out -r linux-x64
RUN dotnet publish -c Release -o ./obj/Docker/publish

# Build runtime image
FROM microsoft/dotnet:2.0-runtime-deps
FROM microsoft/aspnetcore:2.0.8 as release
RUN groupadd -r dotnet && useradd --no-log-init -r -g dotnet -d /home/dotnet -ms /bin/bash dotnet
USER dotnet
WORKDIR /home/dotnet/app
ENV ASPNETCORE_URLS=http://+:9999
COPY --chown=dotnet:dotnet --from=build-env /app/out ./
ENTRYPOINT ["./Hamuste"]
COPY --from=build-env /app/obj/Docker/publish .
ENTRYPOINT ["dotnet", "Hamuste.dll"]

0 comments on commit f65fc9a

Please sign in to comment.