-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (15 loc) · 696 Bytes
/
Dockerfile
File metadata and controls
21 lines (15 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM mcr.microsoft.com/dotnet/sdk:7.0.306-alpine3.18-amd64 AS build
WORKDIR /app
# Copy fsproj and restore as distinct layers
COPY src/Exercism.Analyzer.FSharp/Exercism.Analyzer.FSharp.fsproj ./
RUN dotnet restore -r linux-musl-x64
# Copy everything else and build
COPY src/Exercism.Analyzer.FSharp/ ./
RUN dotnet publish -r linux-musl-x64 -c Release -o /opt/analyzer --no-restore --self-contained true
# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0.9-alpine3.18-amd64 AS runtime
WORKDIR /opt/analyzer
COPY --from=build /opt/analyzer/ .
COPY --from=build /usr/local/bin/ /usr/local/bin/
COPY bin/run.sh /opt/analyzer/bin/
ENTRYPOINT ["sh", "/opt/analyzer/bin/run.sh"]