Skip to content

update list of dd-trace-dotnet files removed from layer #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

# Set line endings to LF, even on Windows. Otherwise, execution within Docker fails.
# See https://help.github.com/articles/dealing-with-line-endings/
*.sh text eol=lf
*.bash text eol=lf
42 changes: 17 additions & 25 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest as builder
FROM ubuntu:latest AS builder
ARG TRACER_VERSION
ARG ARCH

Expand All @@ -19,32 +19,24 @@ RUN dpkg -i /tmp/tracer.deb

WORKDIR /opt

# remove some useless files in a serverless context to keep the package as small as possible
RUN rm datadog/createLogPath.sh && \
rm datadog/*.so && \
rm datadog/loader.conf && \
rm datadog/**/loader.conf && \
rm datadog/**/libddwaf.so && \
# Revise to use 'Datadog.Trace.ClrProfiler.Native.so' for profiling, which calls
# 'Datadog.Trace.Native.so' and 'Datadog.Trace.Profiler.so'.
rm datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
rm datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
rm datadog/**/Datadog.Profiler.Native.so && \
rm datadog/**/Datadog.Trace.MSBuild.* && \
rm datadog/**/*.pdb && \
rm datadog/**/*.xml && \
rm datadog/dd-dotnet.sh && \
rm datadog/**/dd-dotnet && \
# remove files unused in a serverless context to keep the package as small as possible
RUN rm -f datadog/createLogPath.sh && \
rm -f datadog/*.so && \
rm -f datadog/loader.conf && \
rm -f datadog/**/libddwaf.so && \
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
rm -f datadog/**/Datadog.Profiler.Native.so && \
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
rm -f datadog/**/libdatadog_profiling.so \
rm -f datadog/**/*.pdb && \
rm -f datadog/**/*.xml && \
rm -f datadog/dd-dotnet.sh && \
rm -f datadog/**/dd-dotnet && \
rm -rf datadog/net461 && \
rm -rf datadog/netstandard2.0 && \
rm -rf datadog/netcoreapp3.1 && \
rm -rf datadog/continuousprofiler

# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
#
# We are doing this because the actual 'Datadog.Trace.ClrProfiler.Native.so' is a demux which calls this binary and 'Datadog.Trace.Profiler.so'.
RUN if [ -f datadog/linux-x64/Datadog.Tracer.Native.so ]; then mv datadog/linux-x64/Datadog.Tracer.Native.so datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so; fi
RUN if [ -f datadog/linux-arm64/Datadog.Tracer.Native.so ]; then mv datadog/linux-arm64/Datadog.Tracer.Native.so datadog/linux-arm64/Datadog.Trace.ClrProfiler.Native.so; fi
rm -rf datadog/continuousprofiler \
rm -rf datadog/win-*

# add file with tracer version
RUN echo ${TRACER_VERSION} > datadog/tracer_version.txt
Expand Down
16 changes: 6 additions & 10 deletions scripts/Dockerfile.benchmark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest as builder
FROM ubuntu:latest AS builder
ARG ARCH

# make the args mandatory
Expand All @@ -11,28 +11,24 @@ WORKDIR /opt
# Copy current branch tracer build
COPY tracer-build datadog

# remove some useless files in a serverless context to keep the package as small as possible
# remove files unused in a serverless context to keep the package as small as possible
RUN rm -f datadog/createLogPath.sh && \
rm -f datadog/*.so && \
rm -f datadog/loader.conf && \
rm -f datadog/**/loader.conf && \
rm -f datadog/**/libddwaf.so && \
rm -f datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
rm -f datadog/**/Datadog.Profiler.Native.so && \
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
rm -f datadog/**/libdatadog_profiling.so \
rm -f datadog/**/*.pdb && \
rm -f datadog/**/*.xml && \
rm -f datadog/dd-dotnet.sh && \
rm -f datadog/**/dd-dotnet && \
rm -rf datadog/net461 && \
rm -rf datadog/netstandard2.0 && \
rm -rf datadog/netcoreapp3.1 && \
rm -rf datadog/continuousprofiler

# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
RUN if [ -f datadog/linux-x64/Datadog.Tracer.Native.so ]; then mv datadog/linux-x64/Datadog.Tracer.Native.so datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so; fi
RUN if [ -f datadog/linux-arm64/Datadog.Tracer.Native.so ]; then mv datadog/linux-arm64/Datadog.Tracer.Native.so datadog/linux-arm64/Datadog.Trace.ClrProfiler.Native.so; fi
rm -rf datadog/continuousprofiler \
rm -rf datadog/win-*

# zip the layer
RUN mkdir /datadog
Expand Down
18 changes: 5 additions & 13 deletions scripts/Dockerfile.r2r
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,24 @@ RUN mkdir -p datadog
RUN if [ "${ARCH}" = "amd64" ]; then cp -r artifacts/x64/* datadog; fi
RUN if [ "${ARCH}" = "arm64" ]; then cp -r artifacts/arm64/* datadog; fi

# remove some useless files in a serverless context to keep the package as small as possible
# remove files unused in a serverless context to keep the package as small as possible
RUN rm -f datadog/createLogPath.sh && \
rm -f datadog/*.so && \
rm -f datadog/loader.conf && \
rm -f datadog/**/loader.conf && \
rm -f datadog/**/libddwaf.so && \
# Revise to use 'Datadog.Trace.ClrProfiler.Native.so' for profiling, which calls
# 'Datadog.Trace.Native.so' and 'Datadog.Trace.Profiler.so'.
rm -f datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
rm -f datadog/**/Datadog.Profiler.Native.so && \
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
rm -f datadog/**/libdatadog_profiling.so \
rm -f datadog/**/*.pdb && \
rm -f datadog/**/*.xml && \
rm -f datadog/dd-dotnet.sh && \
rm -f datadog/**/dd-dotnet && \
rm -rf datadog/net461 && \
rm -rf datadog/netstandard2.0 && \
rm -rf datadog/netcoreapp3.1 && \
rm -rf datadog/continuousprofiler

# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
#
# We are doing this because the actual 'Datadog.Trace.ClrProfiler.Native.so' is a demux which calls this binary and 'Datadog.Trace.Profiler.so'.
RUN if [ -f datadog/linux-x64/Datadog.Tracer.Native.so ]; then mv datadog/linux-x64/Datadog.Tracer.Native.so datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so; fi
RUN if [ -f datadog/linux-arm64/Datadog.Tracer.Native.so ]; then mv datadog/linux-arm64/Datadog.Tracer.Native.so datadog/linux-arm64/Datadog.Trace.ClrProfiler.Native.so; fi
rm -rf datadog/continuousprofiler \
rm -rf datadog/win-*

# add file with tracer version
RUN echo ${TRACER_VERSION} > datadog/tracer_version.txt
Expand Down
36 changes: 17 additions & 19 deletions scripts/Dockerfile.sandbox
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest as builder
FROM ubuntu:latest AS builder
ARG TRACER_VERSION
ARG ARCH

Expand All @@ -23,26 +23,24 @@ WORKDIR /opt
RUN rm /opt/datadog/net6.0/Datadog.Trace.dll
COPY /Datadog.Trace.dll /opt/datadog/net6.0/Datadog.Trace.dll

# remove some useless files in a serverless context to keep the package as small as possible
RUN rm datadog/createLogPath.sh && \
rm datadog/*.so && \
rm datadog/loader.conf && \
rm datadog/**/loader.conf && \
rm datadog/**/libddwaf.so && \
rm datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
rm datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
rm datadog/**/Datadog.Profiler.Native.so && \
rm datadog/**/Datadog.Trace.MSBuild.* && \
rm datadog/**/*.pdb && \
rm datadog/**/*.xml && \
# remove files unused in a serverless context to keep the package as small as possible
RUN rm -f datadog/createLogPath.sh && \
rm -f datadog/*.so && \
rm -f datadog/loader.conf && \
rm -f datadog/**/libddwaf.so && \
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
rm -f datadog/**/Datadog.Profiler.Native.so && \
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
rm -f datadog/**/libdatadog_profiling.so \
rm -f datadog/**/*.pdb && \
rm -f datadog/**/*.xml && \
rm -f datadog/dd-dotnet.sh && \
rm -f datadog/**/dd-dotnet && \
rm -rf datadog/net461 && \
rm -rf datadog/netstandard2.0 && \
rm -rf datadog/netcoreapp3.1 && \
rm -rf datadog/continuousprofiler

# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
RUN if [ -f datadog/linux-x64/Datadog.Tracer.Native.so ]; then mv datadog/linux-x64/Datadog.Tracer.Native.so datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so; fi
RUN if [ -f datadog/linux-arm64/Datadog.Tracer.Native.so ]; then mv datadog/linux-arm64/Datadog.Tracer.Native.so datadog/linux-arm64/Datadog.Trace.ClrProfiler.Native.so; fi
rm -rf datadog/continuousprofiler \
rm -rf datadog/win-*

# add file with tracer version
RUN echo ${TRACER_VERSION} > datadog/tracer_version.txt
Expand Down