-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
20 lines (14 loc) · 851 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM mcr.microsoft.com/dotnet/sdk:7.0-cbl-mariner-amd64@sha256:5d500e11acc40a224cd71ffb625b16d6d312fecd36abc41fdd5de560b5a97be5 AS build
ARG TARGETARCH
ARG TARGETOS
RUN arch=$TARGETARCH \
&& if [ "$arch" = "amd64" ]; then arch="x64"; fi \
&& echo $TARGETOS-$arch > /tmp/rid
WORKDIR /source
COPY . .
RUN dotnet restore -r $(cat /tmp/rid) /p:PublishReadyToRun=true
RUN dotnet publish src/JamieMagee.Stethoscope.Cli/JamieMagee.Stethoscope.Cli.csproj -c Release -f net7.0 -o /app -r $(cat /tmp/rid) --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true /p:PublishSingleFile=true
FROM mcr.microsoft.com/dotnet/nightly/runtime-deps:7.0-cbl-mariner-distroless@sha256:e379a973ab697d46d502d488224d4239d3a44a3d36f4365361829933b8409204
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["./JamieMagee.Stethoscope.Cli"]