-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
61 lines (40 loc) · 2.08 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
########################################################################################################################
# shellcheck - lining for bash scrips
FROM nlknguyen/alpine-shellcheck:v0.4.6
COPY ./ ./
# Convert CRLF to CR as it causes shellcheck warnings.
RUN find . -type f -name '*.sh' -exec dos2unix {} \;
# 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
########################################################################################################################
# .NET Core 2.1
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-alpine
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
RUN apk add --no-cache --update dos2unix
WORKDIR /work
# Copy just the solution and proj files to make best use of docker image caching
COPY ./abioc.sln .
COPY ./src/Abioc/Abioc.csproj ./src/Abioc/Abioc.csproj
COPY ./test/Abioc.Tests.Internal/Abioc.Tests.Internal.csproj ./test/Abioc.Tests.Internal/Abioc.Tests.Internal.csproj
COPY ./test/Abioc.Tests/Abioc.Tests.csproj ./test/Abioc.Tests/Abioc.Tests.csproj
# Run restore on just the project files, this should cache the image after restore.
RUN dotnet restore
COPY . .
RUN dos2unix -k -q ./coverage.sh
RUN ./coverage.sh netcoreapp2.1 Debug
########################################################################################################################
# .NET Core 2.2
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
RUN apk add --no-cache --update dos2unix
WORKDIR /work
# Copy just the solution and proj files to make best use of docker image caching
COPY ./abioc.sln .
COPY ./src/Abioc/Abioc.csproj ./src/Abioc/Abioc.csproj
COPY ./test/Abioc.Tests.Internal/Abioc.Tests.Internal.csproj ./test/Abioc.Tests.Internal/Abioc.Tests.Internal.csproj
COPY ./test/Abioc.Tests/Abioc.Tests.csproj ./test/Abioc.Tests/Abioc.Tests.csproj
# Run restore on just the project files, this should cache the image after restore.
RUN dotnet restore
COPY . .
RUN dos2unix -k -q ./coverage.sh
RUN ./coverage.sh netcoreapp2.1 Debug