forked from NethermindEth/nethermind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
47 lines (37 loc) · 1.97 KB
/
Dockerfile.dev
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
# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG BUILDPLATFORM
ARG BUILD_TIMESTAMP
ARG COMMIT_HASH
COPY . .
RUN if [ "$TARGETARCH" = "amd64" ] ; \
then dotnet tool install JetBrains.dotTrace.GlobalTools --version 2021.3.2 --tool-path /tmp/ && \
dotnet add src/Nethermind/Nethermind.Runner package JetBrains.dotMemory.Console.$TARGETOS-x64 --version 2021.3.2 --package-directory /tmp/ && \
dotnet publish src/Nethermind/Nethermind.Runner -r $TARGETOS-x64 -c release -p:Commit=$COMMIT_HASH -p:BuildTimestamp=$BUILD_TIMESTAMP -o out ; \
else dotnet tool install JetBrains.dotTrace.GlobalTools --version 2021.3.2 --tool-path /tmp/ && \
dotnet add src/Nethermind/Nethermind.Runner package JetBrains.dotMemory.Console.$TARGETOS-$TARGETARCH --version 2021.3.2 --package-directory /tmp/ && \
dotnet publish src/Nethermind/Nethermind.Runner -r $TARGETOS-$TARGETARCH -c release -p:Commit=$COMMIT_HASH -p:BuildTimestamp=$BUILD_TIMESTAMP -o out ; \
fi
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
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:7.0
RUN apt-get update && apt-get -y install libsnappy-dev libc6-dev libc6 procps && \
rm -rf /var/lib/apt/lists/*
WORKDIR /nethermind
COPY --from=build /out .
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
ENV PATH="/opt/dotnetcore-tools:${PATH}"
LABEL git_commit=$COMMIT_HASH
EXPOSE 8545 8551 30303
VOLUME /nethermind/nethermind_db
VOLUME /nethermind/logs
VOLUME /nethermind/keystore
ENTRYPOINT ["./Nethermind.Runner"]