-
Notifications
You must be signed in to change notification settings - Fork 890
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (35 loc) · 2.09 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (35 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Create a container for running the OpenTelemetry W3C Trace Context tests https://github.com/w3c/trace-context/tree/main/test.
# This should be run from the root of the repo:
# docker build --file test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/Dockerfile .
ARG BUILD_SDK_VERSION=10.0
ARG TEST_SDK_VERSION=10.0
FROM mcr.microsoft.com/dotnet/sdk:8.0.423-azurelinux3.0@sha256:daacd6373eb1057871c96650027b7caf5a47ef13c7bbd1a14ff0604d1e3255fe AS dotnet-sdk-8.0
FROM mcr.microsoft.com/dotnet/sdk:9.0.316-azurelinux3.0@sha256:4120019aebbe3c4a14de067a917812ea919276ee9bba90d995cd94266ec93a12 AS dotnet-sdk-9.0
FROM mcr.microsoft.com/dotnet/sdk:10.0.302-azurelinux3.0@sha256:75de0c7f206f64085c8020f84f35fbf17bfc47768c5bae78d84ab10c2fbc018f AS dotnet-sdk-10.0
FROM dotnet-sdk-${BUILD_SDK_VERSION} AS build
ARG PUBLISH_CONFIGURATION=Release
ARG PUBLISH_FRAMEWORK=net10.0
# renovate: datasource=github-digest depName=w3c/trace-context packageName=w3c/trace-context currentValue=main
ENV W3C_TRACE_CONTEXT_SHA="acab820be9db7b3433668baa5cdd43f57f4c4be0"
WORKDIR /repo
COPY . ./
WORKDIR "/repo/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests"
RUN dotnet publish "OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj" -c "${PUBLISH_CONFIGURATION}" -f "${PUBLISH_FRAMEWORK}" -o /drop -p:IntegrationBuild=true
RUN git init /w3c/trace-context \
&& cd /w3c/trace-context \
&& git remote add origin https://github.com/w3c/trace-context.git \
&& git fetch --depth 1 origin "${W3C_TRACE_CONTEXT_SHA}" \
&& git checkout FETCH_HEAD \
&& rm -rf /w3c/trace-context/.git
FROM dotnet-sdk-${TEST_SDK_VERSION} AS final
WORKDIR /test
COPY /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/requirements.txt .
COPY --from=build /drop .
COPY --from=build /w3c/trace-context ./trace-context
RUN tdnf install -y python3-pip \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& python3 -m pip install --requirement requirements.txt --require-hashes --break-system-packages \
&& tdnf clean all
ENV SPEC_LEVEL=2
ENV STRICT_LEVEL=2
ENTRYPOINT ["dotnet", "vstest", "OpenTelemetry.Instrumentation.W3cTraceContext.Tests.dll"]