Repository navigation
Expand file tree
/
Copy pathDockerfile.diag
More file actions
58 lines (44 loc) · 2.08 KB
/
Copy pathDockerfile.diag
File metadata and controls
58 lines (44 loc) · 2.08 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
# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:11.0-resolute 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") && \
dotnet add src/Nethermind/Nethermind.Runner package JetBrains.dotMemory.Console.linux-$arch \
--package-directory /tmp && \
dotnet add src/Nethermind/Nethermind.Runner package JetBrains.dotTrace.CommandLineTools.linux-$arch \
--package-directory /tmp && \
dotnet publish src/Nethermind/Nethermind.Runner -c $BUILD_CONFIG -a $arch -o /publish --no-self-contained \
-p:SourceRevisionId=$COMMIT_HASH
# `dotnet tool install` runs on $BUILDPLATFORM and writes apphosts for it, which fail with
# "exec format error" in a cross-built image. Download the latest single-file builds for $TARGETARCH instead.
RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \
mkdir -p /root/.dotnet/tools && \
for tool in dotnet-counters dotnet-dump dotnet-gcdump dotnet-trace; do \
curl -fsSL "https://aka.ms/$tool/linux-$arch" -o "/root/.dotnet/tools/$tool" && \
chmod +x "/root/.dotnet/tools/$tool" || exit 1; \
done
FROM mcr.microsoft.com/dotnet/aspnet:11.0-resolute
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
COPY --from=build /tmp/jetbrains.dottrace.commandlinetools.*/**/tools /opt/diag-tools/dottrace
COPY --chmod=0755 scripts/diag-entrypoint.sh entrypoint.sh
ENV PATH="$PATH:/opt/diag-tools:/opt/diag-tools/dotmemory:/opt/diag-tools/dottrace"
STOPSIGNAL SIGINT
ENTRYPOINT ["./entrypoint.sh"]