neo-node icon indicating copy to clipboard operation
neo-node copied to clipboard

Publish neo-cli to docker hub

Open lock9 opened this issue 6 years ago • 11 comments

Hello, I was wondering if we could publish neo-cli to docker hub. It's quite easy to start a node with neo-python using Docker, I was wondering if we could do the same using neo-cli. We have a single node image in neo-local, but it was made to work as a consensus node (setup private network). I'm looking for a way to easily start a neo-cli (with or without RPC) pointing to a specific network. A build system would also help a lot, so we can use the latest master and development versions.

If you guys need help with this task, @nunojusto is an expert in this subject and is also responsible for the latest versions of neo-local.

lock9 avatar Feb 26 '19 17:02 lock9

Sure, I can make this. What you want is a relay node, not a consensus node, right? I can make the Dockerfile that you can use to build it. Or we can manage to have a docker hub for NEO also, but for that i need official help.

nunojusto avatar Feb 26 '19 17:02 nunojusto

I think that if you can provide us with a working Dockerfile, one that copies that configuration from the current project and compiles it, it would be great. Not sure how to handle the "--rpc" flag, but I'm sure this is easy for you :) Do you think we need to use an intermediary image to build and another to host it? Maybe it makes more sense from a security perspective.

So basically, we need:

  • Compile it from source
  • Copy configuration files (config / protocol.json) - probably done when you copy the source files
  • Start it with or without the RPC flag

lock9 avatar Feb 27 '19 14:02 lock9

Yes, I can provide a dockerfile that does that. Including getting the newest code from github, compile it and produce a docker image that we can use to start the node. That image, because it's not consensus, can be then put inside a swarm or kubernetes cluster to be an highly available service.

nunojusto avatar Feb 27 '19 14:02 nunojusto

Like you mentioned in slack, there is already a Dockerfile: https://github.com/neo-project/neo-cli/tree/master/ci

It does 50% of the work, however:

  • it always starts with RPC
  • it compiles and runs in the same image

lock9 avatar Feb 27 '19 14:02 lock9

I think we can start with the Dockerfile we have in the repo and correct/extend it. Let me work on it...

nunojusto avatar Feb 27 '19 14:02 nunojusto

@nunojusto if possible, please check if it is importing plugins, this is quite important too. https://github.com/neo-project/neo-plugins

lock9 avatar Feb 27 '19 14:02 lock9

@nunojusto if possible, please check if it is importing plugins, this is quite important too. https://github.com/neo-project/neo-plugins

No plugins are used in the actual Dockerfile

nunojusto avatar Feb 27 '19 14:02 nunojusto

I'm not sure (I'll leave that to the specialists), but I think that "SimplePolicy" is a mandatory plugin, "RpcSecurity" and "ApplicationLogs" are highly recommended.

lock9 avatar Feb 27 '19 14:02 lock9

You are correct, SimplePolicy is mandatory. I've incorporated it on neo-local long ago.

nunojusto avatar Feb 27 '19 14:02 nunojusto

@neo-project/ngd any chances you guys can help move this forward? I think this will help a lot of people, just look how many "ubuntu" or other "compilation issues" we have in our closed issues. This would "solve" them all. Thanks.

lock9 avatar Jul 22 '19 19:07 lock9

@neo-project/ngd any chances you guys can help move this forward?

I think this is a great idea. We definitely can help to provide it.

longfeiWan9 avatar Jul 26 '19 01:07 longfeiWan9