-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (16 loc) · 742 Bytes
/
Dockerfile
File metadata and controls
23 lines (16 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.103-alpine3.23 AS build
ARG TARGETARCH
WORKDIR /app
# Copy csproj and restore as distinct layer
COPY src/Exercism.Analyzers.CSharp/Exercism.Analyzers.CSharp.csproj .
RUN dotnet restore -a $TARGETARCH
# Copy everything else and build
COPY src/Exercism.Analyzers.CSharp .
RUN dotnet publish -a $TARGETARCH --no-restore --self-contained true --output /opt/analyzer
# Build runtime image
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime-deps:10.0.3-alpine3.23 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"]