-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
36 lines (29 loc) · 2.2 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
# To build one auto-instrumentation image for dotnet, please:
# - Download your dotnet auto-instrumentation artifacts to the `/autoinstrumentation` directory. This is required as when instrumenting the pod,
# one init container will be created to copy the files to your app's container.
# - Grant the necessary access to the files in the `/autoinstrumentation` directory.
# - Following environment variables are injected by the k8s operator to the application container to enable the .NET auto-instrumentation.
# CORECLR_ENABLE_PROFILING=1
# CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
# CORECLR_PROFILER_PATH=%InstallationLocation%/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so # for glibc based images
# CORECLR_PROFILER_PATH=%InstallationLocation%/linux-musl-x64/OpenTelemetry.AutoInstrumentation.Native.so # for musl based images
# DOTNET_ADDITIONAL_DEPS=%InstallationLocation%/AdditionalDeps
# DOTNET_SHARED_STORE=%InstallationLocation%/store
# DOTNET_STARTUP_HOOKS=%InstallationLocation%/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll
# OTEL_DOTNET_AUTO_HOME=%InstallationLocation%
# OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin, Splunk.OpenTelemetry.AutoInstrumentation
# - For auto-instrumentation by container injection, the Linux command cp is
# used and must be availabe in the image.
FROM busybox AS downloader
ARG RELEASE_VER
WORKDIR /autoinstrumentation
ADD https://github.com/signalfx/splunk-otel-dotnet/releases/download/$RELEASE_VER/splunk-opentelemetry-dotnet-linux-glibc-x64.zip .
ADD https://github.com/signalfx/splunk-otel-dotnet/releases/download/$RELEASE_VER/splunk-opentelemetry-dotnet-linux-musl-x64.zip .
RUN unzip splunk-opentelemetry-dotnet-linux-glibc-x64.zip &&\
unzip splunk-opentelemetry-dotnet-linux-musl-x64.zip "linux-musl-x64/*" -d . &&\
rm splunk-opentelemetry-dotnet-linux-glibc-x64.zip splunk-opentelemetry-dotnet-linux-musl-x64.zip &&\
chmod -R go+r .
FROM busybox
LABEL org.opencontainers.image.source="https://github.com/signalfx/splunk-otel-dotnet"
LABEL org.opencontainers.image.description="Splunk Distribution of OpenTelemetry .NET"
COPY --from=downloader /autoinstrumentation /autoinstrumentation