opentelemetry-dotnet/test/OpenTelemetry.Instrumentati.../dockerfile

23 lines
1.6 KiB
Plaintext

# Create a container for running the OpenTelemetry redis unit tests.
# This should be run from the root of the repo:
# opentelemetry>docker build -f test\OpenTelemetry.Instrumentation.StackExchangeRedis.Tests\dockerfile .
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS base
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build
ARG PUBLISH_CONFIGURATION=Release
ARG PUBLISH_FRAMEWORK=netcoreapp3.1
WORKDIR /src
COPY ["NuGet.config", ""] # Needed for the .NET 5 preview packages. Won't be needed in the future.
COPY ["test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj", "test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/"]
COPY ["src/OpenTelemetry.Instrumentation.StackExchangeRedis/OpenTelemetry.Instrumentation.StackExchangeRedis.csproj", "src/OpenTelemetry.Instrumentation.StackExchangeRedis/"]
COPY ["src/OpenTelemetry/OpenTelemetry.csproj", "src/OpenTelemetry/"]
COPY ["src/OpenTelemetry.Api/OpenTelemetry.Api.csproj", "src/OpenTelemetry.Api/"]
RUN dotnet restore "test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj" --configfile "NuGet.config"
COPY . .
WORKDIR "/src/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests"
RUN dotnet publish "OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj" -c "${PUBLISH_CONFIGURATION}" -f "${PUBLISH_FRAMEWORK}" -o /build -p:IntegrationBuild=true --no-restore
FROM base AS final
WORKDIR /test
COPY --from=build /build .
ENTRYPOINT ["dotnet", "test", "OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.dll"]