-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.tests
More file actions
54 lines (45 loc) · 1.91 KB
/
Copy pathDockerfile.tests
File metadata and controls
54 lines (45 loc) · 1.91 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
44
45
46
47
48
49
50
51
52
53
54
# syntax=docker/dockerfile:1.7
ARG DOTNET_VERSION=10.0
ARG UBUNTU_FLAVOR=noble
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-${UBUNTU_FLAVOR}
ARG DOTNET_VERSION
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 \
DOTNET_NOLOGO=1 \
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 \
NUGET_XMLDOC_MODE=skip \
CI=false
WORKDIR /work
# The .NET 10 SDK can build net9.0, but it does not include the net9.0 runtime.
# Your local test projects target both net10.0 and net9.0 when CI != true.
RUN if [ "${DOTNET_VERSION}" = "10.0" ]; then \
apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates git \
&& curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \
&& chmod +x /tmp/dotnet-install.sh \
&& /tmp/dotnet-install.sh --channel 9.0 --runtime dotnet --install-dir /usr/share/dotnet \
&& rm -rf /tmp/dotnet-install.sh /var/lib/apt/lists/*; \
else \
apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git \
&& rm -rf /var/lib/apt/lists/*; \
fi
COPY . .
ENTRYPOINT ["/bin/bash", "-lc"]
CMD [ "\
set -euo pipefail; \
project=\"${TEST_PROJECT:-Savvyio.slnx}\"; \
configuration=\"${CONFIGURATION:-Debug}\"; \
framework=\"${TEST_FRAMEWORK:-}\"; \
filter=\"${TEST_FILTER:-}\"; \
echo \"Architecture: $(uname -m)\"; \
echo \"Project: $project\"; \
echo \"Configuration: $configuration\"; \
echo \"Framework: ${framework:-all}\"; \
dotnet --info; \
dotnet restore \"$project\"; \
args=(dotnet test \"$project\" --no-restore --configuration \"$configuration\" -p:SkipSignAssembly=true --logger \"console;verbosity=normal\"); \
if [ -n \"$framework\" ]; then args+=(--framework \"$framework\"); fi; \
if [ -n \"$filter\" ]; then args+=(--filter \"$filter\"); fi; \
printf 'Command: '; printf '%q ' \"${args[@]}\"; echo; \
\"${args[@]}\" \
" ]