https://github.com/simeononsecurity/xmrig-docker
WIP - A newer, automatically latest, docker container for xmrig.
https://github.com/simeononsecurity/xmrig-docker
cryptocurrency docker docker-container docker-image dockerfile mining mining-algorithms
Last synced: 9 months ago
JSON representation
WIP - A newer, automatically latest, docker container for xmrig.
- Host: GitHub
- URL: https://github.com/simeononsecurity/xmrig-docker
- Owner: simeononsecurity
- License: apache-2.0
- Created: 2025-05-31T00:33:04.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-05-31T02:00:50.000Z (11 months ago)
- Last Synced: 2025-06-08T19:08:10.946Z (11 months ago)
- Topics: cryptocurrency, docker, docker-container, docker-image, dockerfile, mining, mining-algorithms
- Language: Shell
- Homepage: https://simeononsecurity.com
- Size: 50.8 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XMRig Docker Container
This Docker container automatically downloads and runs the latest version of [XMRig](https://github.com/xmrig/xmrig), a high-performance RandomX, KawPow, CryptoNight, AstroBWT and GhostRider CPU miner.
Repository: [https://github.com/simeononsecurity/xmrig-docker](https://github.com/simeononsecurity/xmrig-docker)
_________
[](https://github.com/sponsors/simeononsecurity) [](https://hub.docker.com/r/simeononsecurity/xmrig)
## 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
```bash
docker pull simeononsecurity/xmrig:latest
```
#### GitHub Container Registry
```bash
docker pull ghcr.io/simeononsecurity/xmrig:latest
```
### Basic Usage
```bash
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:
```bash
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:
```bash
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:
```bash
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:
```bash
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:
```bash
docker-compose up -d
```
## Building the Image
```bash
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.
Explore the World of Cybersecurity
### **Links:**
- #### [github.com/simeononsecurity](https://github.com/simeononsecurity)
- #### [simeononsecurity.com](https://simeononsecurity.com)