moneroexamples / onion-monero-blockchain-explorer

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

The Docker image cannot accept CMD or flags #253

Closed sethforprivacy closed 2 years ago

sethforprivacy commented 2 years ago

Currently, the image is not able to accept any CMD entry or any command line flags passed with the docker run command or passed via the command: entry in Docker Compose yaml files.

The only way to pass flags is to include them in the Dockerfile ENTRYPOINT layer, like so:

ENTRYPOINT ["/bin/sh", "-c", "./xmrblocks --enable-json-api --enable-autorefresh-option --enable-emission-monitor --deamon-url=node2.sethforprivacy.com:18089 --enable-pusher"]

If you attempt to pass via CMD layer, the image fails to start, like so:

CMD ["--enable-json-api", "--enable-autorefresh-option", "--enable-emission-monitor", "--enable-pusher"]

And when passing flags via docker run, the flags are simply ignored:

docker run -it -v "/var/lib/docker/volumes/node_bitmonero/_data/.bitmonero:/home/monero/.bitmonero" -p 8081:8081 xmrblocks --enable-emission-monitor

Honestly I'm not sure how to resolve this, as every other executable I've containerized properly handles CMD, like monerod and p2pool:

sethforprivacy commented 2 years ago

Relevant docs:

https://docs.docker.com/engine/reference/builder/#entrypoint https://docs.docker.com/engine/reference/builder/#cmd

sethforprivacy commented 2 years ago

The CMD entry should set sane defaults that are overridden by the user as desired, but unfortunately neither method works ATM, making a pre-packaged image practically useless at the moment.

I'll keep investigating this.

sethforprivacy commented 2 years ago

Nevermind, I found the solution and PR'd:

https://github.com/moneroexamples/onion-monero-blockchain-explorer/pull/254