Skip to content

Commit

Permalink
Fix Dockerfile after bringing Math submodule (#4708)
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaszRozmej authored Oct 5, 2022
1 parent 3f42850 commit 2c31eb6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions Dockerfile.gmp
Original file line number Diff line number Diff line change
@@ -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 .
3 changes: 2 additions & 1 deletion Dockerfile.stateRunner
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]

0 comments on commit 2c31eb6

Please sign in to comment.