Mining in a container


riegel7

Recommended Posts

Hi all!
I want to mine some XMR (Monero). I do successfully with xmrig in a Windows VM. However I would like to mine without having to run a VM.

I got as far as installing and running a container from Dockerhub (this one: https://hub.docker.com/r/xmrig/xmrig/ there are so many more though, and I don't know how to choose and I am scared of opening to the door to malware, i.e. mining for someone else with a modified xmrig binary or something.).

However, it is an (too) old version of the mining software xmrig and I gave up when I wasn't able to enable huge pages (I guess it's not enabled in unRAID's kernel?). I also got errors from the pool.

 

Anyway, has anyone done this successfully and can give me some pointers? Maybe even running it directly on Slackware instead of Docker?

Thanks

Link to comment
  • 5 months later...

If the link I pulled is from the "official" site for Monero, then this should be what you are looking for:

https://ww.getmonero.org/resources/user-guides/mining_with_xmrig_and_docker.html

I found the guide by going to their site under Resources > User Guides > Mining > Mining with Docker & XMRig

 

Who wrote the guide is beyond me especially since they refer to themselves in the guide. I'm sure you can message some of the Monero devs and inquire more about the author of the guide.

 

Quote

there are so many more though, and I don't know how to choose and I am scared of opening to the door to malware,

I don't know anything about XMRig, but it looks like their code is up on GitHub, so I'd dig around in their source code for anything dubious.

The same thing goes for looking at a Docker image.

 

It looks like the "official" software from the monero developers has a function to solo mine built into the software. Have you thought about starting there? Maybe the function is also built into their CLI It looks like the CLI version of their software can mine so, you might be able to build a docker image using the Alpine docker image as your base.

 

A quick search on Docker Hub shows me that kannix's docker image is the most popular.

image.thumb.png.20199bb35786a0c1bc87f64a63b17b0c.png

You will want to examine the Dockerfile for more clues. in kannix's case he's chosen Ubuntu for the OS install — which, if you want a lean install, you should go with Arch Linux (I know @binhex is a fan of Arch Linux due to his Docker builds.) Although, after some digging around it looks like Alpine docker is even leaner.

 

However, in looking at his GitHub repository, someone filed a bug report stating that "Did you know that your container was used by someone else to make a virus?" but then doesn't reply when kannix inquires for more information. Not only that, but kannix's response doesn't instill confidence. Moreover, kannix likes to fork branches instead of developing code for the main branches he's forking off of; for what reason, I don't know. Even though he explicitly says it in his Dockerfile read me, you will see that if you run his docker image with the default settings, that you will be mining monero for him. With that being said, there could be many other maintainers out there throwing their version of mining software that may or may not throw kickbacks to the author — much like how people share referral codes on social media.

 

So, check out some Dockerfiles from devs that you already trust to see what they are doing with the files and also check out some tutorials on how to create and wrap your own dockers. Hopefully that will help you decide on which dockers to install. And like I said before, take a look at the program's source code for clues.

 

Thanks for the interesting question and for the boondoggle. I might just have to tinker around myself for fun one of these weekends.

Edited by Zer0Nin3r
Found more information about solo mining from the official source
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.