This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
forked from JSkimming/Castle.Core.AsyncInterceptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
62 lines (42 loc) · 2.67 KB
/
Dockerfile
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
55
56
57
58
59
60
61
62
########################################################################################################################
# shellcheck - lining for bash scrips
FROM koalaman/shellcheck-alpine:stable
COPY . .
# Run shell check on all the shell files.
RUN find . -type f -name '*.sh' | wc -l find . -type f -name '*.sh' | xargs shellcheck --external-sources --color=always
########################################################################################################################
# .NET Core 3.1
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine
WORKDIR /work
# Copy just the solution and proj files to make best use of docker image caching.
COPY ./castle.core.asyncinterceptor.sln .
COPY ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj
COPY ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
# Run restore on just the project files, this should cache the image after restore.
RUN dotnet restore
COPY . .
RUN ./coverage.sh netcoreapp3.1 Debug
########################################################################################################################
# .NET 5
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine
WORKDIR /work
# Copy just the solution and proj files to make best use of docker image caching.
COPY ./castle.core.asyncinterceptor.sln .
COPY ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj
COPY ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
# Run restore on just the project files, this should cache the image after restore.
RUN dotnet restore
COPY . .
RUN ./coverage.sh net5.0 Debug
########################################################################################################################
# .NET 6
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine
WORKDIR /work
# Copy just the solution and proj files to make best use of docker image caching.
COPY ./castle.core.asyncinterceptor.sln .
COPY ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj
COPY ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
# Run restore on just the project files, this should cache the image after restore.
RUN dotnet restore
COPY . .
RUN ./coverage.sh net6.0 Debug