This container allows running xmrig in a docker container.
docker run -it -d --name xmrig patsissons/xmrig -o ca.minexmr.com:5555 -u 47NHecs6qjvDcbx3eW6cDGDwdm3gDqbHs7G8hzPYRxf3YRTcDJw8kXhDxfHinsjHUwVwdFusSn76UHkaz68KurUgHvFmPMH.github-xmrig -p x -a cn/r
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 latest develop builds, run sudo ./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.
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
amdgpu-pro by running /opt/amdgpu-pro/bin/clinfodocker run -it --rm --device=/dev/dri --device=/dev/kfd --group-add=video --entrypoint=/bin/bash patsissons/xmrig -c /opt/amdgpu-pro/bin/clinfoNVIDIA requires both a docker runtime and cuda drivers installed on the host to interact with the hardware.
cuda-drivers (10.2) (use apt-get install --no-install-recommends nvidia-container-toolkit to install)nvidia-docker runtime (use apt-get install --no-install-recommends cuda-drivers to install)You can verify that everythign is working on the host with the following commands
cuda-drivers by running /usr/bin/nvidia-smidocker run -it --rm --runtime=nvidia --entrypoint=/bin/bash patsissons/xmrig -c /usr/bin/nvidia-smiThis 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 for xmrig (default is https://github.com/xmrig/xmrig.git)GIT_BRANCH: use a custom branch or tagCMAKE_FLAGS: use custom cmake flagsPACKAGE_DEPS: use custom installation packagesYou can adjust the following docker build args
CUDA_VERSION: CUDA container version (default is 10.2)CUDA_UBUNTU_VERSION: Ubuntu version of CUDA container (default is 16.04)AMDGPU_VERSION: AMD driver version (default is 17.40-514569)ALPINE_VERSION: image to use for alpine minimalist container (default is latest)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:
1LNY9wSPs913Y9jXMTrrVze1E41nhm6Qv7LhnwdbrnQaQbjDkqxXFmxXGPcFhMBA9gFu47NHecs6qjvDcbx3eW6cDGDwdm3gDqbHs7G8hzPYRxf3YRTcDJw8kXhDxfHinsjHUwVwdFusSn76UHkaz68KurUgHvFmPMHContent type
Image
Digest
Size
1 GB
Last updated
over 5 years ago
docker pull patsissons/xmrig