forked from NethermindEth/nethermind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.chiseled
More file actions
45 lines (32 loc) · 1.23 KB
/
Dockerfile.chiseled
File metadata and controls
45 lines (32 loc) · 1.23 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
# SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.102-noble@sha256:6ba533cc61a5d8c5e7d4b3a3e33e2ddc2efef200b112e4d658303516bfd24255 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 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.2-noble-chiseled@sha256:a80315337f5ca01b98f7fa8b13048cbf74f55cc8a996745ff16e40a7cea268f5
WORKDIR /nethermind
VOLUME /nethermind/keystore
VOLUME /nethermind/logs
VOLUME /nethermind/nethermind_db
EXPOSE 8545 8551 30303
COPY --from=build --chown=app /publish .
USER app
ENTRYPOINT ["./nethermind"]