-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile
33 lines (26 loc) · 918 Bytes
/
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
# start with an sdk enabled alpine image so we can build source
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine as build
WORKDIR /source
# copy source
COPY /src/AzureEventGridSimulator .
# build source and publish as single file called 'AzureEventGridSimulator'
RUN dotnet publish -c release -o /artifact \
-r alpine-x64 \
-f net6.0 \
-v q \
--nologo \
--self-contained true \
-p:PublishReadyToRun=false \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:TrimUnusedDependencies=true
# add binary artifact to new runtime-deps only image
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-alpine
WORKDIR /app
# add tzdata incase we want to set the timezone
RUN apk add --no-cache tzdata
ENV ASPNETCORE_URLS=
# copy the binary only
COPY --from=build /artifact/AzureEventGridSimulator .
ENTRYPOINT ["./AzureEventGridSimulator"]