Skip to content

jonas-merkle/container-xmr-mining

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

container-xmr-mining

A Docker container setup to mine XMR based on XMRig.

Table of contents

Setup

Docker

  1. Requirements

    • Docker
  2. Build the Docker container

    docker build -t xmr-mining-container ./src/ 
  3. Create the configuration file

    Create based on the ./config/config_demo.json a file called ./config/config.json containing your custom settings.

  4. Start the Docker container

    docker run -d --restart unless-stopped --name miner -v $(pwd)/config:/miner-config xmr-mining-container

Docker Compose

  1. Requirements

    • Docker
    • Docker Compose
  2. Create the configuration file

    Create based on the ./config/config_demo.json a file called ./config/config.json containing your custom settings.

  3. Limit the cpu usage

    To limit the cpu usage remove the # at the beginning of the following lines in the docker-compose.yml file:

        #deploy:
        #  resources:
        #    limits:
        #      cpus: "3.0"   # max cpu usage (1.0 equals 1 cpu core) 
  4. Build the container local

    If you ar not using a linux x86 containerhost or want to build the container on startup the remove the # at the beginning of the following lines in the docker-compose.yml file:

        #build:
        #  context: ./src
        #  dockerfile: ./Dockerfile

    And add add a # at the beginning of the following line:

        image: ghcr.io/jonas-merkle/container-xmr-mining:master
  5. Start container

    The default start command is:

    docker-compose up -d

    If you changed something in section 4. of this tutorial the use this command to start the container:

    docker-compose up -d --build
  6. Stop container

    docker-compose down