Skip to content

Commit 7b9298e

Browse files
authored
.NET OTel AutoInstrumentation - multistage docker image build (open-telemetry#2680)
to reduce image size
1 parent f95596e commit 7b9298e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

autoinstrumentation/dotnet/Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# - For auto-instrumentation by container injection, the Linux command cp is
1515
# used and must be availabe in the image.
1616

17-
FROM busybox
17+
FROM busybox as downloader
1818

1919
ARG version
2020

@@ -26,4 +26,8 @@ ADD https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/relea
2626
RUN unzip opentelemetry-dotnet-instrumentation-linux-glibc.zip &&\
2727
unzip opentelemetry-dotnet-instrumentation-linux-musl.zip "linux-musl-x64/*" -d . &&\
2828
rm opentelemetry-dotnet-instrumentation-linux-glibc.zip opentelemetry-dotnet-instrumentation-linux-musl.zip &&\
29-
chmod -R go+r .
29+
chmod -R go+r .
30+
31+
FROM busybox
32+
33+
COPY --from=downloader /autoinstrumentation /autoinstrumentation

0 commit comments

Comments
 (0)