diff --git a/Dockerfile b/Dockerfile index 93093470b34..ef4284a03e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,10 @@ ARG BUILDPLATFORM COPY . . RUN if [ "$TARGETARCH" = "amd64" ] ; \ - then dotnet publish src/Nethermind/Nethermind.Runner -r $TARGETOS-x64 -c release -o out ; \ - else dotnet publish src/Nethermind/Nethermind.Runner -r $TARGETOS-$TARGETARCH -c release -o out ; \ + then git submodule update --init src/Math.Gmp.Native && \ + dotnet publish src/Nethermind/Nethermind.Runner -r $TARGETOS-x64 -c release -o out ; \ + else git submodule update --init src/Math.Gmp.Native && \ + dotnet publish src/Nethermind/Nethermind.Runner -r $TARGETOS-$TARGETARCH -c release -o out ; \ fi FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:6.0-jammy diff --git a/Dockerfile.dev b/Dockerfile.dev index 8277072ed9b..d0201fb168c 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -8,10 +8,12 @@ ARG BUILDPLATFORM COPY . . RUN if [ "$TARGETARCH" = "amd64" ] ; \ - then dotnet tool install JetBrains.dotTrace.GlobalTools --version 2021.3.2 --tool-path /tmp/ && \ + then git submodule update --init src/Math.Gmp.Native && \ + 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 -o out ; \ - else dotnet tool install JetBrains.dotTrace.GlobalTools --version 2021.3.2 --tool-path /tmp/ && \ + else git submodule update --init src/Math.Gmp.Native && \ + 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 -o out ; \ fi diff --git a/Dockerfile.gmp b/Dockerfile.gmp new file mode 100644 index 00000000000..1accb9339e1 --- /dev/null +++ b/Dockerfile.gmp @@ -0,0 +1,17 @@ +FROM debian@sha256:acf7795dc91df17e10effee064bd229580a9c34213b4dba578d64768af5d8c51 AS gmp +WORKDIR /source + +RUN apt-get update && apt-get install -y mercurial autoconf automake libtool texinfo build-essential bison + +RUN hg clone https://gmplib.org/repo/gmp-6.2/ gmp && \ + cd gmp && \ + ./.bootstrap && \ + ./configure --disable-static --enable-shared && \ + make -j16 + +RUN strip gmp/.libs/libgmp.so + + +FROM debian@sha256:acf7795dc91df17e10effee064bd229580a9c34213b4dba578d64768af5d8c51 AS libgmp +WORKDIR /nethermind +COPY --from=gmp /source/gmp/.libs/libgmp.so . diff --git a/Dockerfile.stateRunner b/Dockerfile.stateRunner index 4f82330223e..6afeafbe023 100644 --- a/Dockerfile.stateRunner +++ b/Dockerfile.stateRunner @@ -3,10 +3,11 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build COPY . . RUN apk add git && \ + git submodule update --init src/Math.Gmp.Native && \ dotnet publish src/Nethermind/Nethermind.State.Test.Runner -c release -o out FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine COPY --from=build /out . -ENTRYPOINT [ "./nethtest" ] +ENTRYPOINT [ "./nethtest" ] \ No newline at end of file