forked from NethermindEth/nethermind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.diag
42 lines (30 loc) · 1.33 KB
/
Dockerfile.diag
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
# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
ARG BUILD_CONFIG=release
ARG BUILD_TIMESTAMP
ARG CI
ARG COMMIT_HASH
ARG TARGETARCH
COPY src/Nethermind src/Nethermind
RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \
dotnet add src/Nethermind/Nethermind.Runner package JetBrains.dotMemory.Console.linux-$arch \
--package-directory /tmp && \
dotnet publish src/Nethermind/Nethermind.Runner -c $BUILD_CONFIG -a $arch -o /publish --sc false \
-p:BuildTimestamp=$BUILD_TIMESTAMP -p:Commit=$COMMIT_HASH
RUN dotnet tool install -g dotnet-dump && \
dotnet tool install -g dotnet-gcdump && \
dotnet tool install -g dotnet-trace && \
dotnet tool install -g JetBrains.dotTrace.GlobalTools
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-noble
WORKDIR /nethermind
VOLUME /nethermind/diag
VOLUME /nethermind/keystore
VOLUME /nethermind/logs
VOLUME /nethermind/nethermind_db
EXPOSE 8545 8551 30303
COPY --from=build /publish .
COPY --from=build /root/.dotnet/tools /opt/diag-tools
COPY --from=build /tmp/jetbrains.dotmemory.console.*/**/tools /opt/diag-tools/dotmemory
ENV PATH="$PATH:/opt/diag-tools:/opt/diag-tools/dotmemory"
ENTRYPOINT ["./nethermind"]