From afce0cd3de1e5c74f5869a63e506a92cf25a919e Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Wed, 13 Nov 2024 08:42:22 +0000 Subject: [PATCH] Update dockerfiles --- examples/Example.AspNetCore.Mvc/Dockerfile | 4 ++-- examples/Example.AutoInstrumentation/Dockerfile | 11 +++++------ .../distribution.Dockerfile | 5 ++--- .../ExampleApplicationContainer.cs | 1 - 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/Example.AspNetCore.Mvc/Dockerfile b/examples/Example.AspNetCore.Mvc/Dockerfile index ddf5378..0b2a591 100644 --- a/examples/Example.AspNetCore.Mvc/Dockerfile +++ b/examples/Example.AspNetCore.Mvc/Dockerfile @@ -1,10 +1,10 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base USER $APP_UID WORKDIR /app EXPOSE 8080 EXPOSE 8081 -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["examples/Example.AspNetCore.Mvc/Example.AspNetCore.Mvc.csproj", "examples/Example.AspNetCore.Mvc/"] diff --git a/examples/Example.AutoInstrumentation/Dockerfile b/examples/Example.AutoInstrumentation/Dockerfile index 234387c..732630e 100644 --- a/examples/Example.AutoInstrumentation/Dockerfile +++ b/examples/Example.AutoInstrumentation/Dockerfile @@ -1,5 +1,5 @@ -ARG OTEL_VERSION=1.7.0 -FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base +ARG OTEL_VERSION=1.9.0 +FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base ARG TARGETPLATFORM ARG TARGETARCH ARG TARGETVARIANT @@ -18,8 +18,7 @@ ADD https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/relea RUN chmod +x otel-dotnet-auto-install.sh RUN OTEL_DOTNET_AUTO_HOME="/app/otel" sh otel-dotnet-auto-install.sh - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build_example +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build_example ENV _PROJECT="Example.AutoInstrumentation" ENV _PROJECTPATH="${_PROJECT}/${_PROJECT}.csproj" WORKDIR /work @@ -33,7 +32,7 @@ RUN dotnet build "${_PROJECT}.csproj" -c Release -o /app/build_example FROM build_example AS publish_example RUN dotnet publish "Example.AutoInstrumentation.csproj" -c Release -o /app/example /p:UseAppHost=false -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build_distro +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build_distro ENV _PROJECT="Elastic.OpenTelemetry" ENV _PROJECTPATH="${_PROJECT}/${_PROJECT}.csproj" WORKDIR /work @@ -56,7 +55,7 @@ ENV CORECLR_ENABLE_PROFILING="1" ENV CORECLR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}" ENV CORECLR_PROFILER_PATH="/app/otel/linux-${TARGETARCH}/OpenTelemetry.AutoInstrumentation.Native.so" ENV OTEL_DOTNET_AUTO_PLUGINS="Elastic.OpenTelemetry.AutoInstrumentationPlugin, Elastic.OpenTelemetry, Version=1.0.0.0, Culture=neutral, PublicKeyToken=069ca2728db333c1" - + ENV OTEL_TRACES_EXPORTER=none ENV OTEL_METRICS_EXPORTER=none ENV OTEL_LOGS_EXPORTER=none diff --git a/examples/Example.AutoInstrumentation/distribution.Dockerfile b/examples/Example.AutoInstrumentation/distribution.Dockerfile index e965f3c..2c840e5 100644 --- a/examples/Example.AutoInstrumentation/distribution.Dockerfile +++ b/examples/Example.AutoInstrumentation/distribution.Dockerfile @@ -1,5 +1,5 @@ -ARG OTEL_VERSION=1.7.0 -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG OTEL_VERSION=1.9.0 +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build ARG TARGETPLATFORM ARG TARGETARCH ARG TARGETVARIANT @@ -19,7 +19,6 @@ COPY examples/${_PROJECT} examples/${_PROJECT} WORKDIR "/work/examples/${_PROJECT}" RUN dotnet publish "${_PROJECT}.csproj" -c Release -a $TARGETARCH --no-restore -o /app/example - FROM build AS final COPY ".artifacts/elastic-distribution" /distro/elastic diff --git a/tests/AutoInstrumentation.IntegrationTests/ExampleApplicationContainer.cs b/tests/AutoInstrumentation.IntegrationTests/ExampleApplicationContainer.cs index 4914e20..8f40078 100644 --- a/tests/AutoInstrumentation.IntegrationTests/ExampleApplicationContainer.cs +++ b/tests/AutoInstrumentation.IntegrationTests/ExampleApplicationContainer.cs @@ -50,7 +50,6 @@ public ExampleApplicationContainer() .WithLogger(ConsoleLogger.Instance) .WithOutputConsumer(_output) .Build(); - } public async Task InitializeAsync()