Skip to content

Commit

Permalink
fix dockerfil
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlh committed Jun 19, 2018
1 parent 68a830c commit 692f92d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
FROM microsoft/dotnet:2.0-sdk-stretch AS build-env

RUN useradd -d /home/dotnet -ms /bin/bash dotnet
USER dotnet

WORKDIR /home/dotnet/app
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY ./src/Hamuste.csproj ./
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

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

# Build runtime image
FROM microsoft/dotnet:2.0-runtime-deps
RUN useradd -d /home/dotnet -ms /bin/bash dotnet
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 --from=build-env /home/dotnet/app/out ./
COPY --chown=dotnet:dotnet --from=build-env /app/out ./
ENTRYPOINT ["./Hamuste"]

0 comments on commit 692f92d

Please sign in to comment.