-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (17 loc) · 806 Bytes
/
Dockerfile
File metadata and controls
25 lines (17 loc) · 806 Bytes
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
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 layers
COPY src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj .
RUN dotnet restore -a $TARGETARCH
# Copy everything else and build
COPY src/Exercism.Representers.CSharp/ ./
RUN dotnet publish -a $TARGETARCH --no-restore --self-contained true --output /opt/representer
# Build runtime image
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime-deps:10.0.3-alpine3.23 AS runtime
WORKDIR /opt/representer
COPY --from=build /opt/representer/ .
COPY --from=build /usr/local/bin/ /usr/local/bin/
COPY bin/run.sh bin/run.sh
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
ENTRYPOINT ["sh", "/opt/representer/bin/run.sh"]