forked from NosCoreIO/NosCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
40 lines (29 loc) · 1.31 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM microsoft/dotnet:2.1-runtime-deps-alpine
# Disable the invariant mode (set in base image)
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
# Install .NET Core SDK
ENV DOTNET_SDK_VERSION 2.1.300-preview3-008443
RUN apk add --no-cache --virtual .build-deps \
openssl \
&& wget -O dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-alpine.3.6-x64.tar.gz \
&& dotnet_sha512='2b52ab97ed874a6251ac14376049a94a10c70c2b867e38500143ba37bd8517760df72a027c6865ead1faa6504718c1384942d4bbc7842093afbe123e83f2997c' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -C /usr/share/dotnet -xzf dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
&& rm dotnet.tar.gz \
&& apk del .build-deps
# Enable correct mode for dotnet watch (only mode supported in a container)
ENV DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps perfomance
NUGET_XMLDOC_MODE=skip
WORKDIR /app
COPY . .
RUN dotnet restore
RUN dotnet build
WORKDIR /app/build/netcoreapp2.0
EXPOSE 5000 6969
ENTRYPOINT ["dotnet", "NosCore.MasterServer.dll"]