-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (26 loc) · 813 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
34
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /action
ENV TZ="America/Chicago"
# Copy everything
COPY src/PlotGitHubAction/*.cs .
COPY src/PlotGitHubAction/Utils/*.cs .
COPY src/PlotGitHubAction/PlotGitHubAction.csproj .
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
# Runtime IDs: https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
RUN dotnet publish \
--configuration Release \
--runtime linux-x64 \
--no-self-contained \
-o built
# Check size
RUN du -sh .
RUN du -sh built
# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime:8.0
COPY --from=build-env /action/built/ /action
# required for fonts
RUN apt update && \
apt install -y libfontconfig1
ENTRYPOINT ["/action/PlotGitHubAction"]