Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (45 loc) · 2.53 KB
/
Copy pathDockerfile
File metadata and controls
60 lines (45 loc) · 2.53 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
59
60
# syntax=docker/dockerfile:1.26@sha256:ecfaec9ed6d810b56388c508f4121597bfbba70d41a6dfeee4d8cad5f295fc32
# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:11.0.100-resolute@sha256:df45bb838cf806ad4436aac1bf2246187824dd6b87c7c6d08b35238a33a57112 AS build
ARG BUILD_CONFIG=release
ARG CI=true
ARG COMMIT_HASH
ARG SOURCE_DATE_EPOCH
ARG TARGETARCH
WORKDIR /nethermind
COPY global.json nuget.config Directory.Build.props Directory.Build.targets Directory.Packages.props ./
COPY --parents src/Nethermind/**/*.csproj src/Nethermind/Directory.Build.props src/Nethermind/Directory.Build.targets src/Nethermind/Nethermind.Runner/packages.lock.json ./
RUN cd src/Nethermind/Nethermind.Runner && dotnet restore --locked-mode
COPY src/Nethermind src/Nethermind
RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \
cd src/Nethermind/Nethermind.Runner && \
dotnet publish -c $BUILD_CONFIG -a $arch -o /publish --no-restore --no-self-contained \
-p:SourceRevisionId=$COMMIT_HASH
# A temporary symlink to support the old executable name
RUN ln -sr /publish/nethermind /publish/Nethermind.Runner
FROM mcr.microsoft.com/dotnet/aspnet:11.0.0-resolute@sha256:529e320c926237e4e65460db697c580d8f83c0c573bb340e6846a7e8d46cb8bf
ARG COMMIT_HASH=unknown
ARG VERSION=unknown
ARG BUILD_TIMESTAMP=1970-01-01T00:00:00Z
# An ARG is out of scope after a FROM, so the three above must be redeclared in this stage.
# Without that, the values below silently resolve to an empty string. The defaults keep a plain
# `docker build` with no build args self-describing rather than blank.
LABEL org.opencontainers.image.title="Nethermind" \
org.opencontainers.image.description="A robust execution client for Ethereum node operators." \
org.opencontainers.image.vendor="Demerzel Solutions Limited" \
org.opencontainers.image.licenses="LGPL-3.0-only" \
org.opencontainers.image.url="https://nethermind.io/nethermind-client" \
org.opencontainers.image.documentation="https://docs.nethermind.io" \
org.opencontainers.image.source="https://github.com/NethermindEth/nethermind" \
org.opencontainers.image.version="$VERSION" \
org.opencontainers.image.revision="$COMMIT_HASH" \
org.opencontainers.image.created="$BUILD_TIMESTAMP"
WORKDIR /nethermind
VOLUME /nethermind/keystore
VOLUME /nethermind/logs
VOLUME /nethermind/nethermind_db
EXPOSE 8545 8551 30303 30303/udp
COPY --from=build /publish .
COPY scripts/entrypoint.sh .
ENTRYPOINT ["./entrypoint.sh"]