Skip to content

Commit

Permalink
feat(dotnet): add native AOT example
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunet committed Nov 22, 2022
1 parent 2d22388 commit a789897
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dotnet/Dockerfile.aot
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder

# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends \
clang \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*

WORKDIR /source

COPY . .

RUN dotnet publish /p:PublishAot=true -c Release -o /out

FROM mcr.microsoft.com/dotnet/runtime-deps:7.0

COPY --from=builder /out/demo /bin

CMD ["/bin/demo"]
3 changes: 3 additions & 0 deletions dotnet/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.PHONY: build
build:
docker build -t parca-demo:dotnet .

build-aot:
docker build -f Dockerfile.aot -t parca-demo:dotnet-aot .
8 changes: 8 additions & 0 deletions dotnet/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# .NET

## With JIT compilation

See https://learn.microsoft.com/en-us/dotnet/core/runtime-config/debugging-profiling#export-perf-maps

## With native AOT compilation

Requires .NET 7 or above.

See https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/#native-debug-information

0 comments on commit a789897

Please sign in to comment.