Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise and improve diagnostics Dockerfile #6398

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions Dockerfile.diag
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,39 @@ ARG BUILD_TIMESTAMP
ARG CI
ARG COMMIT_HASH
ARG TARGETARCH
ARG TARGETOS

COPY .git .git
COPY src/Nethermind src/Nethermind

RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \
jb_version=2023.3.0 && \
dotnet tool install JetBrains.dotTrace.GlobalTools --version $jb_version --tool-path /tmp && \
dotnet add src/Nethermind/Nethermind.Runner package JetBrains.dotMemory.Console.$TARGETOS-$arch \
--version $jb_version --package-directory /tmp && \
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 --tool-path /dotnetcore-tools dotnet-trace && \
dotnet tool install --tool-path /dotnetcore-tools dotnet-dump && \
dotnet tool install --tool-path /dotnetcore-tools dotnet-gcdump
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-jammy

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 /dotnetcore-tools /opt/dotnetcore-tools
COPY --from=build /tmp/jetbrains.dotmemory.console.* /opt/tools
COPY --from=build /tmp/dottrace /opt/tools
COPY --from=build /tmp/.store /opt/tools/.store
COPY --from=build /root/.dotnet/tools /opt/diag-tools
COPY --from=build /tmp/jetbrains.dotmemory.console.*/**/tools /opt/diag-tools/dotmemory

ENV PATH="/opt/dotnetcore-tools:${PATH}"
ENV PATH="$PATH:/opt/diag-tools:/opt/diag-tools/dotmemory"

RUN apt-get update && apt-get -y install libsnappy-dev procps && \
RUN apt-get update && apt-get -y install libsnappy-dev && \
rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["./nethermind"]