Skip to content

Commit 6fc2fc1

Browse files
update list of dd-trace-dotnet files removed from layer (#10)
1 parent 04d9f77 commit 6fc2fc1

File tree

5 files changed

+54
-67
lines changed

5 files changed

+54
-67
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
# Set line endings to LF, even on Windows. Otherwise, execution within Docker fails.
7+
# See https://help.github.com/articles/dealing-with-line-endings/
8+
*.sh text eol=lf
9+
*.bash text eol=lf

scripts/Dockerfile

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:latest as builder
1+
FROM ubuntu:latest AS builder
22
ARG TRACER_VERSION
33
ARG ARCH
44

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

2020
WORKDIR /opt
2121

22-
# remove some useless files in a serverless context to keep the package as small as possible
23-
RUN rm datadog/createLogPath.sh && \
24-
rm datadog/*.so && \
25-
rm datadog/loader.conf && \
26-
rm datadog/**/loader.conf && \
27-
rm datadog/**/libddwaf.so && \
28-
# Revise to use 'Datadog.Trace.ClrProfiler.Native.so' for profiling, which calls
29-
# 'Datadog.Trace.Native.so' and 'Datadog.Trace.Profiler.so'.
30-
rm datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
31-
rm datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
32-
rm datadog/**/Datadog.Profiler.Native.so && \
33-
rm datadog/**/Datadog.Trace.MSBuild.* && \
34-
rm datadog/**/*.pdb && \
35-
rm datadog/**/*.xml && \
36-
rm datadog/dd-dotnet.sh && \
37-
rm datadog/**/dd-dotnet && \
22+
# remove files unused in a serverless context to keep the package as small as possible
23+
RUN rm -f datadog/createLogPath.sh && \
24+
rm -f datadog/*.so && \
25+
rm -f datadog/loader.conf && \
26+
rm -f datadog/**/libddwaf.so && \
27+
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
28+
rm -f datadog/**/Datadog.Profiler.Native.so && \
29+
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
30+
rm -f datadog/**/libdatadog_profiling.so \
31+
rm -f datadog/**/*.pdb && \
32+
rm -f datadog/**/*.xml && \
33+
rm -f datadog/dd-dotnet.sh && \
34+
rm -f datadog/**/dd-dotnet && \
35+
rm -rf datadog/net461 && \
3836
rm -rf datadog/netstandard2.0 && \
3937
rm -rf datadog/netcoreapp3.1 && \
40-
rm -rf datadog/continuousprofiler
41-
42-
# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
43-
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
44-
#
45-
# We are doing this because the actual 'Datadog.Trace.ClrProfiler.Native.so' is a demux which calls this binary and 'Datadog.Trace.Profiler.so'.
46-
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
47-
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
38+
rm -rf datadog/continuousprofiler \
39+
rm -rf datadog/win-*
4840

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

scripts/Dockerfile.benchmark

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:latest as builder
1+
FROM ubuntu:latest AS builder
22
ARG ARCH
33

44
# make the args mandatory
@@ -11,28 +11,24 @@ WORKDIR /opt
1111
# Copy current branch tracer build
1212
COPY tracer-build datadog
1313

14-
# remove some useless files in a serverless context to keep the package as small as possible
14+
# remove files unused in a serverless context to keep the package as small as possible
1515
RUN rm -f datadog/createLogPath.sh && \
1616
rm -f datadog/*.so && \
1717
rm -f datadog/loader.conf && \
18-
rm -f datadog/**/loader.conf && \
1918
rm -f datadog/**/libddwaf.so && \
20-
rm -f datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
2119
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
2220
rm -f datadog/**/Datadog.Profiler.Native.so && \
2321
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
22+
rm -f datadog/**/libdatadog_profiling.so \
2423
rm -f datadog/**/*.pdb && \
2524
rm -f datadog/**/*.xml && \
2625
rm -f datadog/dd-dotnet.sh && \
2726
rm -f datadog/**/dd-dotnet && \
27+
rm -rf datadog/net461 && \
2828
rm -rf datadog/netstandard2.0 && \
2929
rm -rf datadog/netcoreapp3.1 && \
30-
rm -rf datadog/continuousprofiler
31-
32-
# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
33-
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
34-
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
35-
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
30+
rm -rf datadog/continuousprofiler \
31+
rm -rf datadog/win-*
3632

3733
# zip the layer
3834
RUN mkdir /datadog

scripts/Dockerfile.r2r

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,24 @@ RUN mkdir -p datadog
2121
RUN if [ "${ARCH}" = "amd64" ]; then cp -r artifacts/x64/* datadog; fi
2222
RUN if [ "${ARCH}" = "arm64" ]; then cp -r artifacts/arm64/* datadog; fi
2323

24-
# remove some useless files in a serverless context to keep the package as small as possible
24+
# remove files unused in a serverless context to keep the package as small as possible
2525
RUN rm -f datadog/createLogPath.sh && \
2626
rm -f datadog/*.so && \
2727
rm -f datadog/loader.conf && \
28-
rm -f datadog/**/loader.conf && \
2928
rm -f datadog/**/libddwaf.so && \
30-
# Revise to use 'Datadog.Trace.ClrProfiler.Native.so' for profiling, which calls
31-
# 'Datadog.Trace.Native.so' and 'Datadog.Trace.Profiler.so'.
32-
rm -f datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
3329
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
3430
rm -f datadog/**/Datadog.Profiler.Native.so && \
3531
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
32+
rm -f datadog/**/libdatadog_profiling.so \
3633
rm -f datadog/**/*.pdb && \
3734
rm -f datadog/**/*.xml && \
3835
rm -f datadog/dd-dotnet.sh && \
3936
rm -f datadog/**/dd-dotnet && \
37+
rm -rf datadog/net461 && \
4038
rm -rf datadog/netstandard2.0 && \
4139
rm -rf datadog/netcoreapp3.1 && \
42-
rm -rf datadog/continuousprofiler
43-
44-
# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
45-
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
46-
#
47-
# We are doing this because the actual 'Datadog.Trace.ClrProfiler.Native.so' is a demux which calls this binary and 'Datadog.Trace.Profiler.so'.
48-
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
49-
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
40+
rm -rf datadog/continuousprofiler \
41+
rm -rf datadog/win-*
5042

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

scripts/Dockerfile.sandbox

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:latest as builder
1+
FROM ubuntu:latest AS builder
22
ARG TRACER_VERSION
33
ARG ARCH
44

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

26-
# remove some useless files in a serverless context to keep the package as small as possible
27-
RUN rm datadog/createLogPath.sh && \
28-
rm datadog/*.so && \
29-
rm datadog/loader.conf && \
30-
rm datadog/**/loader.conf && \
31-
rm datadog/**/libddwaf.so && \
32-
rm datadog/**/Datadog.Trace.ClrProfiler.Native.so && \
33-
rm datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
34-
rm datadog/**/Datadog.Profiler.Native.so && \
35-
rm datadog/**/Datadog.Trace.MSBuild.* && \
36-
rm datadog/**/*.pdb && \
37-
rm datadog/**/*.xml && \
26+
# remove files unused in a serverless context to keep the package as small as possible
27+
RUN rm -f datadog/createLogPath.sh && \
28+
rm -f datadog/*.so && \
29+
rm -f datadog/loader.conf && \
30+
rm -f datadog/**/libddwaf.so && \
31+
rm -f datadog/**/Datadog.Linux.ApiWrapper.x64.so && \
32+
rm -f datadog/**/Datadog.Profiler.Native.so && \
33+
rm -f datadog/**/Datadog.Trace.MSBuild.* && \
34+
rm -f datadog/**/libdatadog_profiling.so \
35+
rm -f datadog/**/*.pdb && \
36+
rm -f datadog/**/*.xml && \
37+
rm -f datadog/dd-dotnet.sh && \
38+
rm -f datadog/**/dd-dotnet && \
39+
rm -rf datadog/net461 && \
3840
rm -rf datadog/netstandard2.0 && \
3941
rm -rf datadog/netcoreapp3.1 && \
40-
rm -rf datadog/continuousprofiler
41-
42-
# HACK: rename the tracer library so the logic in datadog_wrapper keeps working
43-
# See also https://github.com/DataDog/datadog-lambda-extension/pull/150
44-
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
45-
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
42+
rm -rf datadog/continuousprofiler \
43+
rm -rf datadog/win-*
4644

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

0 commit comments

Comments
 (0)