-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.RandomDateAPI.dd
34 lines (28 loc) · 1.3 KB
/
Dockerfile.RandomDateAPI.dd
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
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache 2.0 License.
#
FROM mcr.microsoft.com/dotnet/sdk:7.0 as build-env
WORKDIR /home/otel
COPY RandomDateAPI RandomDateAPI/
WORKDIR /home/otel/RandomDateAPI
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /home/otel/RandomDateAPI
COPY --from=build-env /home/otel/RandomDateAPI/out .
RUN apt-get update -y; apt-get install curl -y
# Download and install the Tracer
RUN mkdir -p /opt/datadog \
&& mkdir -p /var/log/datadog \
&& TRACER_VERSION=$(curl -s https://api.github.com/repos/DataDog/dd-trace-dotnet/releases/latest | grep tag_name | cut -d '"' -f 4 | cut -c2-) \
&& curl -LO https://github.com/DataDog/dd-trace-dotnet/releases/download/v${TRACER_VERSION}/datadog-dotnet-apm_${TRACER_VERSION}_arm64.deb \
&& dpkg -i ./datadog-dotnet-apm_${TRACER_VERSION}_arm64.deb \
&& rm ./datadog-dotnet-apm_${TRACER_VERSION}_arm64.deb
# Enable the tracer
ENV CORECLR_ENABLE_PROFILING=1
ENV CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
ENV CORECLR_PROFILER_PATH=/opt/datadog/Datadog.Trace.ClrProfiler.Native.so
ENV DD_DOTNET_TRACER_HOME=/opt/datadog
ENV DD_INTEGRATIONS=/opt/datadog/integrations.json
ENTRYPOINT ["dotnet","RandomDateAPI.dll"]
EXPOSE 5077