-
Notifications
You must be signed in to change notification settings - Fork 709
Expand file tree
/
Copy pathDockerfile.chiseled
More file actions
50 lines (36 loc) · 1.35 KB
/
Copy pathDockerfile.chiseled
File metadata and controls
50 lines (36 loc) · 1.35 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.301-resolute@sha256:196f61c6262aa890f41dd654ff52d3b995187124a37778fb990ed0c31c26da44 AS build
ARG BUILD_CONFIG=release
ARG CI=true
ARG COMMIT_HASH
ARG SOURCE_DATE_EPOCH
ARG TARGETARCH
WORKDIR /nethermind
COPY src/Nethermind src/Nethermind
COPY Directory.*.props .
COPY Directory.Build.targets .
COPY global.json .
COPY nuget.config .
RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \
cd src/Nethermind/Nethermind.Runner && \
dotnet restore --locked-mode && \
dotnet publish -c $BUILD_CONFIG -a $arch -o /publish --no-restore --no-self-contained \
-p:SourceRevisionId=$COMMIT_HASH
# Creating these directories here is needed to ensure the correct permissions
RUN cd /publish && \
mkdir keystore && \
mkdir logs && \
mkdir nethermind_db
FROM mcr.microsoft.com/dotnet/aspnet:10.0.9-resolute-chiseled@sha256:d942d0db45f473ca68a9a9adcb1b2d8886a75d3586a8a08eedbb42046f0dab7c
WORKDIR /nethermind
# For large pages
# ENV DOTNET_GCLargePages=1
# ENV DOTNET_GCRegionRange=0x800000000
VOLUME /nethermind/keystore
VOLUME /nethermind/logs
VOLUME /nethermind/nethermind_db
EXPOSE 8545 8551 30303
COPY --from=build --chown=app /publish .
USER app
ENTRYPOINT ["./nethermind"]