These docker images include the official development cpp-ethereum linux binaries to provide ethminer support.
While there are forks of ethminer that are focused on GPU mining, I wanted to try my hand at CPU mining even though it is not recommended nor profitable. I also wanted to use the official cpp-ethereum source if possible.
These images also include eth
so they could be run as a client/wallet, but for that I would recommend the official
ethereum/client-cpp images since they are smaller and better supported.
tag | description |
---|---|
latest |
same as alpine |
alpine |
latest alpine base image and cpp-ethereum development source |
ubuntu |
latest ubuntu base image and cpp-ethereum development source |
Create some local directories for ethereum data so a new DAG isn't required on every start (optional).
$ mkdir ~/.ethereum ~/.ethash ~/.web3
Run container with .ethash
volume mount and other recommended parameters for ethereum/client-cpp docker images.
$ docker run -it --rm \
--name ethminer-cpp \
-p 127.0.0.1:8545:8545 \
-p 0.0.0.0:30303:30303 \
-v ~/.ethereum:/.ethereum \
-v ~/.ethash:/.ethash \
-v ~/.web3:/.web3 \
-e HOME=/ \
--user $(id -u):$(id -g) \
klutchell/ethminer-cpp <options>
If running in detached mode, you can view the logs with the following command:
$ docker logs -t ethminer-cpp
You can optionally also use the provided bin/docker-ethminer
bash script to
start/stop the service on a schedule.
Edit the volume mounts and mining parameters as needed before running the script.
You can optionally also use the provided docker-compose.yml
for running as
a service either with docker-compose or docker swarm.
Edit the volume mounts and entrypoint as needed before creating stack.
Create a new stack with the
$ docker stack deploy --compose-file docker-compose.yml miner
The same deploy command will pull the latest image and update the container as needed.
$ docker stack deploy --compose-file docker-compose.yml miner
This will stop the miner and remove the stack.
$ docker stack rm miner
This will stop the ethminer-cpp service.
$ docker service scale miner_ethminer-cpp=0
This will start the ethminer-cpp service.
$ docker service scale miner_ethminer-cpp=1