forked from rebornix/DotBadge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (25 loc) · 1002 Bytes
/
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
# Using SDK image to build
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build
WORKDIR /app
# Restore first
COPY DotBadge/DotBadge.csproj DotBadge/DotBadge.csproj
COPY DotBadge.CommandLine/DotBadge.CommandLine.csproj DotBadge.CommandLine/DotBadge.CommandLine.csproj
RUN dotnet restore DotBadge.CommandLine/DotBadge.CommandLine.csproj
# Copy everything needed
COPY DotBadge/* DotBadge/
COPY DotBadge.CommandLine/* DotBadge.CommandLine/
# Build dotnet unit tests
RUN dotnet publish -c Release -o /app/out /app/DotBadge.CommandLine/DotBadge.CommandLine.csproj
# Using runtime image + libgdiplus for Drawing
FROM mcr.microsoft.com/dotnet/core/runtime:3.0 as dotnet-tests
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --allow-unauthenticated \
libc6-dev \
libgdiplus \
libx11-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy files from build
COPY --from=build /app/out/ .
#Run
ENTRYPOINT ["dotnet", "DotBadge.CommandLine.dll" ]