1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Monero CPU Mining in Docker

Discussion in 'Software Stuff' started by Patrick, Jan 22, 2017.

  1. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    For those who want an easy way to mine Monero (XMR) using Docker here is a simple way to run a fairly optimized miner in Docker:
    Code:
    docker run -d -e username=example@example.com servethehome/monero_cpu_minergate
    
    Replace example@example.com with your minergate username.

    This Docker image will compile and run Wolf's CPU miner, automatically detect L3 cache size and launch miners using L3 cache / 2 for threads.

    The advantage of using this method is that you can use this to easily launch Monero CPU mining on a Docker swarm cluster.

    Note, there are no fees for using this image. If you do want to sign up using our minergate affiliate link (this would be appreciated), here it is:
    Smart multicurrency mining pool & 1-click GUI miner

    This Docker image seems to be working well on 1-4 socket Intel systems:

    upload_2017-1-22_17-7-45.png

    Alternative pool miners (use your wallet address instead of example@example.com)
    Alternative 1: Moneropool
    Code:
    docker run -d -e username=example@example.com servethehome/monero_cpu_moneropool
    
    Alternative 2: xmrpool.net
    Code:
    docker run -d -e username=example@example.com servethehome/monero_cpu_xmrpooldotnet
    
    Feedback is welcome. NVIDIA mining Docker image coming this week.
     
    #1
    Last edited: Jan 31, 2017
    Marsh likes this.
  2. MiniKnight

    MiniKnight Well-Known Member

    Joined:
    Mar 30, 2012
    Messages:
    1,848
    Likes Received:
    453
    Nice job on this. I have a higher hash rate than with moneropool too.

    I'm going to signup again with minergate to use your code unless you accept donations?
     
    #2
  3. nitrobass24

    nitrobass24 Moderator

    Joined:
    Dec 26, 2010
    Messages:
    756
    Likes Received:
    42
    Is Monero profitable right now?
     
    #3
  4. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    Depends on what you are mining with and electricity costs.

    It is a good way to utilize excess power in a data center rack that you are already paying for.

    In Texas and places with inexpensive electricity I believe it is.

    Monero has not been impacted by ASICs like Bitcoin.
     
    #4
  5. TangoWhiskey9

    TangoWhiskey9 Active Member

    Joined:
    Jun 28, 2013
    Messages:
    321
    Likes Received:
    34
    I noticed you've gotten 1 bad share. What bad share percentage are you guys at?
     
    #5
  6. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    I am at a total of 26 bad shares or 0.0027% thus far which is not the most concerning for me.
     
    #6
  7. TangoWhiskey9

    TangoWhiskey9 Active Member

    Joined:
    Jun 28, 2013
    Messages:
    321
    Likes Received:
    34
    1 improvement or suggestion

    I keep forgetting the username= in the docker cli. If I do that the image doesn't run. Can't I just put an e-mail address without the username?
     
    #7
  8. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    Updated to the servethehome repo on Docker hub.

    Added a moneropool image (higher-fees but an alternative)
    Code:
    docker run -d -e username=walletID servethehome/monero_cpu_moneropool
    Replace walletID with the ID for your wallet. Moneropool will automatically clear balances of over 0.4 XMR every few hours. I do have a stranded 0.1 XMR balance there because of this :-/ Since the pools do get DDoS'd I wanted to have an option.

    Let me know if there is another pool you want to see added.
     
    #8
  9. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    Added xmrpool.net as well
    Code:
    docker run -d -e username=walletID servethehome/monero_cpu_xmrpooldotnet
     
    #9
  10. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    Ok - this is really cool. One week later here are the Docker hub stats:

    upload_2017-2-6_21-0-9.png
     
    #10
    nthu9280 likes this.
  11. Jon Massey

    Jon Massey Active Member

    Joined:
    Nov 11, 2015
    Messages:
    260
    Likes Received:
    65
    Bear with me chaps, having been a .net developer for the past 10 years and not used much in the way of linux I'm being thrown back in the deep end with an ubuntu workstation on the first day of my PhD so it's probably me that's being a bit dim but...

    installed docker.io via apt-get, joined minergate, pulled the docker image but running it doesn't seem to do an awful lot:

    Code:
    sudo docker run -itd -e username=[redacted]@gmail.com servethehome/monero_cpu_minergate
    cbbdfc49899bde56dcc6aedace66144c688421e7a65d4946a7c234c763368903
    
    Every time a run it I just get a hex string back instantly and then it returns - is this the expected behaviour?



    EDIT: welp, I shouldn't have been so hasty - it just needed a second or two to start up!
     
    #11
    Last edited: Feb 15, 2017 at 8:37 AM
  12. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    @Jon Massey - yes!

    Now do:
    Code:
    docker ps
    And you will see the image running. If you want to see what the image is doing real-time (using that container ID string):
    Code:
    docker attach cbbdfc
    You can then hit ctrl + p q to return. If you hit ctrl + c you will stop mining.

    docker ps should also give you a name (last entry) that you can use instead of cbbdfc....

    I actually think monero mining is a great way to learn Docker.
     
    #12
  13. Jon Massey

    Jon Massey Active Member

    Joined:
    Nov 11, 2015
    Messages:
    260
    Likes Received:
    65
    Ah excellent, thanks @Patrick ! I'll kill off all the extra instances I started up! Seems like I was getting ~85H/s from each of the two instances I just killed. This is on a HP Z440 w/ E5-1620 v3 and 40GB of RAM.

    Pleasantly surprised by how running all this in the background didn't seem to affect the usability of this system. I shall have to look into how much I'm paying for electricity at home to see if it's worthwhile running there.
     
    #13
    Patrick likes this.
  14. Jon Massey

    Jon Massey Active Member

    Joined:
    Nov 11, 2015
    Messages:
    260
    Likes Received:
    65
    Left running Friday-Mon morning with 1 cpu instance and 1 gpu instance I've mined the princely sum of 0.1moneros or just over 1eur. Not sure this is going to be worth much!
     
    #14
  15. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    #15
  16. Jon Massey

    Jon Massey Active Member

    Joined:
    Nov 11, 2015
    Messages:
    260
    Likes Received:
    65
    Just my workstation with a E5-1620 v3 K620. I've got a couple of old dual X5650 boxes at home which are currently unused (project leftovers), but as they're an older gen and I pay for the electricity there I'm hesitant to spin them back up. I do have a Firepro W7000, a GTX 970 and a GTX750ti that I could press into service, though.
     
    #16
  17. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    I guess that is about right. The Monero bits perform better with higher core counts. AMD GPUs are the big winners in terms of H/s per watt. What H/s are you seeing?
     
    #17
  18. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,383
    Likes Received:
    2,264
    As a quick note, I recently changed the password for this image to hostname. If you are running this in a swarm, this makes it extremely easy to determine the hashrate of a worker (and if a worker is down). xmrpool.net supports this feature:
    upload_2017-2-20_8-30-31.png
    It displays container ID. That allows you to tie back easily to a GUI such as Rancher or Portainer:
    upload_2017-2-20_8-34-14.png
     
    #18
  19. Jon Massey

    Jon Massey Active Member

    Joined:
    Nov 11, 2015
    Messages:
    260
    Likes Received:
    65
    If I attach to the respective docker containers the terminal says 90H/s on the GPU, 250H/s on the CPU. The dashboard in minergate varies wildly from 100-450H/s
     
    #19
Similar Threads: Monero Mining
Forum Title Date
Software Stuff Monero CPU Mining with Docker Swarm Mode Jan 30, 2017
Software Stuff Monero GPU mining in Docker with nvidia-docker Jan 22, 2017
Software Stuff Zcash CPU Mining with Docker Jan 31, 2017
Software Stuff Zcash getting started with CPU mining (easily) Nov 14, 2016
Software Stuff Zcash - any STHers Mining? Nov 11, 2016

Share This Page