-
Notifications
You must be signed in to change notification settings - Fork 676
Expand file tree
/
Copy pathDockerfile.chiseled
More file actions
48 lines (35 loc) · 1.49 KB
/
Dockerfile.chiseled
File metadata and controls
48 lines (35 loc) · 1.49 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
# SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.202-noble@sha256:adc02be8b87957d07208a4a3e51775935b33bad3317de8c45b1e67357b4c073b 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 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 restore -r "linux-${arch}" -p:PublishReadyToRun=true && \
dotnet publish -c $BUILD_CONFIG -r "linux-${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.6-noble-chiseled@sha256:5472257bbea16e7749bc6a402caa02880fabf744c088af7e73045324c560296e
WORKDIR /nethermind
# Chiseled image has no shell — large pages cannot be auto-detected.
# To enable: docker run -e DOTNET_GCLargePages=1 -e 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"]