Giter Club home page Giter Club logo

docker-xmrig-mo's Introduction

xmrig-mo-docker

A tiny docker container for quickly getting up and running with the MoneroOcean fork of xmrig.

Docker Image Size (latest by date) GitHub Workflow Status Xmrig Version

Table of Contents

Quick start

โš ๏ธ Unfortunately it is not possible to apply MSR mod without the privileged flag. This carries severe security implications and should not be used lightly as it grants full access to the host.

NOTE: The command provided is an example and should be adjusted for your needs.

Launch the miner with the following command:

docker run -d \
  --name="xmrig-mo" \
  -p "127.0.0.1:3001:3001" \
  -v /cfg/xmrig-mo:/cfg \
  -e WALLET_ADDRESS="88yUzYzB9wrR2r2o1TzXxDMENr6Kbadr3caqKTBUNFZ3dWVt6sJcpWBAwMwNRtEi7nHcBcqzmExNfdNK7ughaCeUFuXXpPp" \
  --restart=always \
  --privileged \
  thelolagemann/xmrig-mo:latest

Where:

  • /cfg/xmrig-mo: The directory that will contain any configuration files.
  • WALLET_ADDRESS: The XMR wallet address to mine to.

Upon first running the container, the miner will perform a short benchmark that should take just a few minutes. These results are saved in the config.json file under the mounted /cfg directory. Once these benchmarks are complete, you will be able to access the xmrig-workers GUI at http://host-ip:3001.

Usage

docker run [-d] \
  --name=xmrig-mo \
  [ -e <VARIABLE_NAME>=<VALUE>]... \
  [-v <HOST_DIR>:<CONTAINER_DIR>[:PERMISSIONS] ]... \
  [-p <HOST_PORT>:<CONTAINER_PORT> ]... \
  thelolagemann/xmrig-mo
Parameter Description
-d Run the container in the background. If not set, the container runs in the foreground.
-e Pass an environment variable to the container. See the Environment Variables section for more details.
-v Set a volume mapping (allows to share a folder between the host and the container). See the Data Volumes section for more details
-p Set a network port mapping (exposes an internal container port to the host). See the Ports section for more details

Environment Variables

Variable Description Default
PUID User ID of the application. See User/Group IDs to better understand when and why this should be set. 1000
PGID Group ID of the application. See User/Group IDs to better understand when and why this should be set. 1000
RIG_NAME Name used to identify the mining rig. Randomly generated
API_TOKEN API token used to access the xmrig API. Randomly generated
WALLET_ADDRESS The xmr wallet to payout to. (unset)
XMRIG_API_ENABLED Enable the xmrig API. true
XMRIG_WORKERS_ENABLED Enable xmrig-workers1 true
XMRIG_WORKERS_AUTOCONFIGURE Automatically inject the xmrig api configuration into the xmrig-workers GUI.2 true
BENCHMARK Enable benchmarks. By default the benchmarks will only be performed on the initial run. Useful when deploying to environments with dynamically allocated resources. (unset)

1: Enabling xmrig-workers automatically enables the xmrig API

2: This will automatically inject the API access token which may pose a security risk if you have your container exposed to the internet.

Data Volumes

The following table describes data volumes used by the container. The mappings are set via the -v parameter.

Container Path Permissions Description
/cfg rw This is where the miner stores its configuration.

Ports

A list of ports used by the container. They can be mapped to the host via the -p parameter (one per port mapping).

Port Required Description
3000 No Port used to query the xmrig API
3001 No Port to access xmrig-workers web UI 1

1: Enabling xmrig-workers automatically enables the xmrig API, which may pose issues if port 3000 isn't exposed from the container. In order to overcome this, any requests made to http://localhost:3001 with the Authorization header present are proxied internally.

Docker Compose

Here is an example of a docker-compose.yml file that can be used with docker-compose.

NOTE: Make sure to adjust the configuration according to your needs.

version: "3.9"
services:
  xmrig-mo:
    image: thelolagemann/xmrig-mo
    ports:
    - "3000:3000"
    - "3001:3001"
    volumes:
      - "$HOME/xmrig-mo:/cfg:rw"
    environment:
      - WALLET_ADDRESS: "88yUzYzB9wrR2r2o1TzXxDMENr6Kbadr3caqKTBUNFZ3dWVt6sJcpWBAwMwNRtEi7nHcBcqzmExNfdNK7ughaCeUFuXXpPp"
      - RIG_NAME: "docker-cpu"

Notes

User/Groups IDs

Often when using data volumes (-v flags) with docker, you will run into permissions issues that occur between the host and container. See here for a more detailed breakdown of why this happens.

To avoid these issues, specify the user ID and group ID that the application should run as by specifying the PUID and PGID environment variables. By default, these are set to 1000:1000 which is generally the default UID/GID used for the first non-system account created. If you are unsure as to the UID/GID of a username, run the following command:

id <username>

Which should output something like

uid=1000(username) gid=1000(username) groups=1000(username),4(adm),27(sudo),119(lpadmin)

Configuration

Although the environment variables should provide you with most of the configuration options needed to run this container, there may be times when you want to alter the configuration of xmrig. This is as simple as locating the config.json file in your /cfg mount, making your wanted changes and saving the file. xmrig will automatically reload the configuration when it detects that the file has been modified.

MSR

In order to apply MSR registers, the docker container must be run with the --privileged flag.

Building

In order to build the container run the command.

docker build -f Dockerfile .

When building docker containers, you can pass build arguments with the --build-arg flag. Listed below are the available build arguments you can pass during build.

Argument Description Default
XMRIG_VERSION The version of xmrig-mo to build 6.21.2-mo1

docker-xmrig-mo's People

Contributors

thelolagemann avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-xmrig-mo's Issues

MSR MOD failed on Docker desktop (windows)

MSR MOD is failed on run in my Docker Desktop (Windows). Here is my log. This is the first run of the container:

  • ABOUT XMRig/6.16.4-mo1 gcc/10.3.1
  • LIBS libuv/1.42.0 OpenSSL/1.1.1l hwloc/2.5.0
  • HUGE PAGES supported
  • 1GB PAGES disabled
  • CPU AMD Ryzen 5 5600G with Radeon Graphics (1) 64-bit AES VM
    L2:3.0 MB L3:16.0 MB 6C/12T NUMA:1
  • MEMORY 2.2/7.4 GB (29%)
  • DONATE 0%
  • ASSEMBLY auto:ryzen
  • POOL 1 gulf.moneroocean.stream:10128 algo auto
  • COMMANDS hashrate, pause, resume, results, connection
  • HTTP API 0.0.0.0:3000
    [2022-03-17 15:32:45.020] net use pool gulf.moneroocean.stream:10128 18.210.126.40
    [2022-03-17 15:32:45.020] net new job from gulf.moneroocean.stream:10128 diff 128001 algo rx/0 height 2581662 (18 tx)
    [2022-03-17 15:32:45.020] cpu use argon2 implementation AVX2
    [2022-03-17 15:32:45.021] msr msr kernel module is not available
    [2022-03-17 15:32:45.021] msr FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW

Is there something I can do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.