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

Dockerfile #3

Open
dusmart opened this issue Sep 28, 2023 · 1 comment
Open

Dockerfile #3

dusmart opened this issue Sep 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dusmart
Copy link

dusmart commented Sep 28, 2023

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

RUN wget https://raw.githubusercontent.com/lazynode/lazynode-neo/main/neo.diff && mv neo.diff /tmp/neo.diff

RUN git clone --depth=1 -b v3.6.0 --single-branch https://github.com/neo-project/neo-node.git /tmp/neo-node
RUN git clone --depth=1 -b v3.6.0 --single-branch https://github.com/neo-project/neo.git /tmp/neo
RUN git clone --depth=1 -b v3.6.0 --single-branch https://github.com/neo-project/neo-modules.git /tmp/neo-modules
RUN git clone --depth=1 -b 3.6.0.2 --single-branch https://github.com/Hecate2/neo-fairy-test.git /tmp/neo-fairy-test
RUN cd /tmp/neo && git apply /tmp/neo.diff
RUN cd /tmp/neo-node/neo-cli && dotnet remove package Neo && dotnet add reference /tmp/neo/src/Neo/Neo.csproj && dotnet publish --use-current-runtime -c Release -o /neo
RUN cd /tmp/neo-modules/src/LevelDBStore && dotnet build -c Release -o /neo/Plugins/LevelDBStore
RUN cd /tmp/neo-modules/src/RpcServer && dotnet build -c Release -o /neo/Plugins/RpcServer
RUN cd /tmp/neo-fairy-test && dotnet sln Fairy.sln remove ../neo-modules/src/RpcServer/RpcServer.csproj && dotnet remove reference ../../../neo-node-mainnet/Neo.ConsoleService/Neo.ConsoleService.csproj && dotnet remove reference ../../../neo/src/Neo.Json/Neo.Json.csproj && dotnet remove reference ../RpcServer/RpcServer.csproj && dotnet add reference /tmp/neo-node/Neo.ConsoleService/Neo.ConsoleService.csproj && dotnet add reference /tmp/neo/src/Neo.Json/Neo.Json.csproj && dotnet add reference /tmp/neo-modules/src/RpcServer/RpcServer.csproj && dotnet build -c Release -o /neo/Plugins/Fairy && rm /neo/Plugins/Fairy/RpcServer.dll && cp /tmp/neo-fairy-test/config.json /neo/Plugins/Fairy/config.json

FROM debian:stable-slim

COPY --from=build /neo /neo

RUN apt-get update && apt-get install -y libleveldb-dev libssl-dev

WORKDIR /workspace
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
CMD /neo/neo-cli
docker build . -t neoburger/lazyneofairy:3.6.0

run

copy the fairy's config.json and delete the ipv6 configs, name it fairy.json, map the ports you want to use to local machine

docker run -it --rm --name lazyneofairy -v ./fairy.json:/neo/Plugins/Fairy/config.json -p 16868:16868 neoburger/lazyneofairy:3.6.0
@Hecate2 Hecate2 added the enhancement New feature or request label Sep 28, 2023
@dusmart
Copy link
Author

dusmart commented Nov 6, 2023

add -v "$(pwd)":/workspace option if you need to map current directory into the docker and store the blockchain data there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants