This container allows running xmrig in a docker container.
- A simple one liner to get the container mining right away
docker run -it -d --name xmrig patsissons/xmrig -o ca.minexmr.com:5555 -u 47NHecs6qjvDcbx3eW6cDGDwdm3gDqbHs7G8hzPYRxf3YRTcDJw8kXhDxfHinsjHUwVwdFusSn76UHkaz68KurUgHvFmPMH.github-xmrig -p x -a cn/r
- A more comprehensive script to simplify the process of starting and uprading the miner. Running
sudo ./start-xmrig.sh
will pull down the latest version while still mining, then stop and upgrade the container to resume mining with minimal downtime. If you want to use this script with the latestdevelop
builds, runsudo ./start-xmrig.sh develop
instead. The script is ready to accept overrides for a few environment variables to simplify multi-host distribution.
Environment Variable | Default Value | Notes |
---|---|---|
ADDRESS |
N/A | make sure to replace the default with your own address or you will be mining to my address |
HOST |
hostname -s |
override this if you want a custom host name that is different from your actual host name |
PORT |
8080 |
if another container or process is already using port 8080 this can be adjusted |
POOL_HOST |
N/A | make sure to replace this with your own pool remote uri |
POOL_USER |
$ADDRESS.$HOST-$TAG |
adjust this to your needs |
POOL_PASS |
x |
adjust this to your needs |
POOL_ALGO |
cn/r |
algorithm to use, see docs |
Everything has been tested on Ubuntu 16 LTS (Xenial)
AMD requires only drivers installed on the host to interact with the hardware.
- install the
AMDGPU-Pro
drivers (17.40-514569
) on the host machine and then run the docker image with--device=/dev/dri --device=/dev/kfd --group-add=video
.
You can verify that everything is working on the host with the following commands
- check the status of
amdgpu-pro
by running/opt/amdgpu-pro/bin/clinfo
- test the container integration by running
docker run -it --rm --device=/dev/dri --device=/dev/kfd --group-add=video --entrypoint=/bin/bash patsissons/xmrig -c /opt/amdgpu-pro/bin/clinfo
NVIDIA requires both a docker runtime and cuda drivers installed on the host to interact with the hardware.
- Install the Ubuntu 16.04
cuda-drivers
(10.2
) (useapt-get install --no-install-recommends nvidia-container-toolkit
to install) - Install the
nvidia-docker
runtime (useapt-get install --no-install-recommends cuda-drivers
to install)
You can verify that everythign is working on the host with the following commands
- check the status of the
cuda-drivers
by running/usr/bin/nvidia-smi
- test the container integration by running
docker run -it --rm --runtime=nvidia --entrypoint=/bin/bash patsissons/xmrig -c /usr/bin/nvidia-smi
This image uses a multi-stage build, all that should be required is docker build .
to build the latest image.
You can adjust the following docker environment variables to customize the build process.
GIT_REPOSITORY
: use a custom git repo forxmrig
(default ishttps://github.com/xmrig/xmrig.git
)GIT_BRANCH
: use a custom branch or tagCMAKE_FLAGS
: use custom cmake flagsPACKAGE_DEPS
: use custom installation packages
You can adjust the following docker build args
CUDA_VERSION
: CUDA container version (default is10.2
)CUDA_UBUNTU_VERSION
: Ubuntu version of CUDA container (default is16.04
)AMDGPU_VERSION
: AMD driver version (default is17.40-514569
)ALPINE_VERSION
: image to use for alpine minimalist container (default islatest
)
If you find this docker image useful, donations for work on dockerizing the build and mining app are appreciated at any of the folllowing addresses:
- BTC:
1LNY9wSPs913Y9jXMTrrVze1E41nhm6Qv7
- LTC:
LhnwdbrnQaQbjDkqxXFmxXGPcFhMBA9gFu
- XMR:
47NHecs6qjvDcbx3eW6cDGDwdm3gDqbHs7G8hzPYRxf3YRTcDJw8kXhDxfHinsjHUwVwdFusSn76UHkaz68KurUgHvFmPMH