Repository navigation
Expand file tree
/
Copy pathDockerfile.chiseled
More file actions
68 lines (52 loc) · 2.34 KB
/
Copy pathDockerfile.chiseled
File metadata and controls
68 lines (52 loc) · 2.34 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.403-resolute@sha256:667f3cee6f24afb202d3e32c7941e3800bbac57dd70bb68f89e52a6245aff88f 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.14-resolute-chiseled@sha256:6018ff839e76c1bc9aa58d60c2ba8e596061363c88d8f4f7e45d1c19b6205eaf
ARG COMMIT_HASH=unknown
ARG VERSION=unknown
ARG BUILD_TIMESTAMP=1970-01-01T00:00:00Z
# An ARG is out of scope after a FROM, so the three above must be redeclared in this stage.
# Without that, the values below silently resolve to an empty string. The defaults keep a plain
# `docker build` with no build args self-describing rather than blank.
LABEL org.opencontainers.image.title="Nethermind" \
org.opencontainers.image.description="A robust execution client for Ethereum node operators." \
org.opencontainers.image.vendor="Demerzel Solutions Limited" \
org.opencontainers.image.licenses="LGPL-3.0-only" \
org.opencontainers.image.url="https://nethermind.io/nethermind-client" \
org.opencontainers.image.documentation="https://docs.nethermind.io" \
org.opencontainers.image.source="https://github.com/NethermindEth/nethermind" \
org.opencontainers.image.version="$VERSION" \
org.opencontainers.image.revision="$COMMIT_HASH" \
org.opencontainers.image.created="$BUILD_TIMESTAMP"
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 30303/udp
COPY --from=build --chown=app /publish .
USER app
ENTRYPOINT ["./nethermind"]