decentraland / bronzeage-node

DEPRECATED: This codebase will not be mantained anymore, and formats are going to change when we move to the Decentraland Iron Age
https://decentraland.org
Other
104 stars 22 forks source link

Listing tiles in Docker VM. #32

Open KurzGedanke opened 7 years ago

KurzGedanke commented 7 years ago

For everyone who has struggle with listing the tiles you have in a Docker VM: https://docs.docker.com/engine/reference/commandline/exec/

So it should be something like: docker exec -it nameOfYourDockerContainer ./bin/cli --apikey=$RPC_API_KEY rpc dumpblockchain true | node scripts/list.js (might be wrong, so.. please test it out)

ghost commented 7 years ago

The command tries to pipe to the command "node" running on the host, instead of to the docker image. Likewise, it passes the env variable from the host to the image. You have to pass "sh -c" before the command, and escape the environment variable with a "\" like this:

sudo docker exec -it nameOfYourDockerContainer sh -c "./bin/cli --apikey=\$RPC_API_KEY rpc dumpblockchain true | node scripts/list.js"

The command runs without failing, but I haven't actually had the error since I added more RAM to my VM running docker (it now has 8GB), so the error might still be there for other people.

maraoz commented 7 years ago

Nice contribution @KurzGedanke and @merklaw !