A Docker container setup to mine XMR based on XMRig.
-
Requirements
- Docker
-
Build the Docker container
docker build -t xmr-mining-container ./src/
-
Create the configuration file
Create based on the
./config/config_demo.json
a file called./config/config.json
containing your custom settings. -
Start the Docker container
docker run -d --restart unless-stopped --name miner -v $(pwd)/config:/miner-config xmr-mining-container
-
Requirements
- Docker
- Docker Compose
-
Create the configuration file
Create based on the
./config/config_demo.json
a file called./config/config.json
containing your custom settings. -
Limit the cpu usage
To limit the cpu usage remove the
#
at the beginning of the following lines in thedocker-compose.yml
file:#deploy: # resources: # limits: # cpus: "3.0" # max cpu usage (1.0 equals 1 cpu core)
-
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 thedocker-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
-
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
-
Stop container
docker-compose down