Skip to content

simeononsecurity/xmrig-docker

Repository files navigation

XMRig Docker Container

This Docker container automatically downloads and runs the latest version of XMRig, a high-performance RandomX, KawPow, CryptoNight, AstroBWT and GhostRider CPU miner.

Repository: https://github.com/simeononsecurity/xmrig-docker


Sponsor DockerHub

Features

  • Automatically downloads the latest XMRig release
  • Runs the RandomX boost script at startup for optimal performance
  • Allows custom configuration via mounted config.json
  • Supports passing command-line arguments directly to XMRig
  • CPU-only mining for maximum compatibility and simplicity

Prerequisites

  • Docker installed on your system
  • MSR modules available on the host (for RandomX optimization)

Usage

Pulling the Image

You can pull the image from either Docker Hub or GitHub Container Registry:

Docker Hub

docker pull simeononsecurity/xmrig:latest

GitHub Container Registry

docker pull ghcr.io/simeononsecurity/xmrig:latest

Basic Usage

docker run --privileged simeononsecurity/xmrig:latest

The --privileged flag is required to allow the container to run the RandomX boost script, which needs access to MSR (Model-Specific Registers).

Using a Custom Configuration

You can mount your own config.json file to override the default configuration:

docker run --privileged -v /path/to/your/config.json:/config/config.json simeononsecurity/xmrig:latest

Passing Command-Line Arguments

You can pass arguments directly to XMRig:

docker run --privileged simeononsecurity/xmrig:latest -o pool.example.com:3333 -u YOUR_WALLET_ADDRESS -p x -k

GPU Mining

NVIDIA GPUs

To use NVIDIA GPUs for mining, you need to have the NVIDIA Container Toolkit installed and use the following command:

docker run --privileged --gpus all simeononsecurity/xmrig:latest -o pool.example.com:3333 -u YOUR_WALLET_ADDRESS -p x -k --cuda

The container automatically:

  1. Detects the presence of NVIDIA GPUs
  2. Builds the XMRig CUDA plugin from source code
  3. Configures XMRig to use the CUDA plugin for GPU mining

No additional configuration is required to enable CUDA support. The container includes CUDA Toolkit 12.4 for building the plugin, which supports most modern NVIDIA GPUs. Building from source ensures maximum compatibility and performance.

AMD GPUs

To use AMD GPUs for mining, you need to pass through the GPU devices:

docker run --privileged --device=/dev/dri:/dev/dri --device=/dev/kfd:/dev/kfd simeononsecurity/xmrig:latest -o pool.example.com:3333 -u YOUR_WALLET_ADDRESS -p x -k --opencl

Using Docker Compose

The included docker-compose.yml file is pre-configured for both NVIDIA and AMD GPU support. Simply uncomment the relevant sections and run:

docker-compose up -d

Building the Image

docker build -t xmrig .

Security Considerations

  • Running containers with the --privileged flag grants extensive permissions to the container, which could be a security risk. Only use this container in trusted environments.
  • Always verify the source of Docker images before running them, especially for cryptocurrency mining software.

License

This Dockerfile and associated scripts are provided under the Apache License 2.0. XMRig itself is subject to its own licensing terms.

    SimeonOnSecurity Logo

Links:

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy