moneroexamples / onion-monero-blockchain-explorer

Onion Monero Blockchain Explorer
https://xmrchain.net
BSD 3-Clause "New" or "Revised" License
362 stars 269 forks source link

dockerized xmrblocks #242

Closed victoru closed 2 years ago

victoru commented 2 years ago

Allows xmrblocks to be run in a docker container, you just need to mount the blockchain folder to the appropriate location. Takes just over an hour to build from scratch.

# add --no-cache get latest changes from https://github.com/monero-project/monero
docker build --no-cache -t xmrblocks .
docker run --net=host -v xmrdata:/home/monero/.bitmonero xmrblocks

Using multistage docker builds, it's possible to copy just the xmrblocks binary and its dynamic libraries so the resulting image is under 200MB:

❯ sudo docker images                                                                     
[sudo] password for victor:                                                              
REPOSITORY      TAG       IMAGE ID       CREATED          SIZE 
xmrblocks       latest    9e98882d4110   17 minutes ago   179MB 
moneroexamples commented 2 years ago

Thanks. It works as expected. If you want you can also add some info to README with some instructions on how to use the explorer with docker?