Skip to content

Commit

Permalink
Update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon committed Nov 13, 2024
1 parent 5573706 commit afce0cd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/Example.AspNetCore.Mvc/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/"]
Expand Down
11 changes: 5 additions & 6 deletions examples/Example.AutoInstrumentation/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions examples/Example.AutoInstrumentation/distribution.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public ExampleApplicationContainer()
.WithLogger(ConsoleLogger.Instance)
.WithOutputConsumer(_output)
.Build();

}

public async Task InitializeAsync()
Expand Down

0 comments on commit afce0cd

Please sign in to comment.