├── examples ├── ca.png ├── cuda.png ├── nvidia.png └── webui.png ├── config └── config.json ├── .github ├── ISSUE_TEMPLATE │ └── bug.md └── workflows │ └── main.yml ├── init.sh ├── Dockerfile ├── Dockerfile.cuda10 └── README.md /examples/ca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PTRFRLL/nv-docker-trex/HEAD/examples/ca.png -------------------------------------------------------------------------------- /examples/cuda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PTRFRLL/nv-docker-trex/HEAD/examples/cuda.png -------------------------------------------------------------------------------- /examples/nvidia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PTRFRLL/nv-docker-trex/HEAD/examples/nvidia.png -------------------------------------------------------------------------------- /examples/webui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PTRFRLL/nv-docker-trex/HEAD/examples/webui.png -------------------------------------------------------------------------------- /config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "pools" : 3 | [ 4 | { 5 | "pass" : "x", 6 | "url" : "stratum+ssl://us2.ethermine.org:5555", 7 | "user" : "0x4208E04E6cAC8f496596fbfAFdF140382275C495", 8 | "worker" : "Rig" 9 | } 10 | ], 11 | "api-bind-http" : "0.0.0.0:4067" 12 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Let's get it fixed! 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Output of `nvidia-smi`:** 11 | 12 | Run the `nvidia-smi` command and post the results here 13 | 14 | --- 15 | 16 | **Container logs here:** 17 | 18 | Post any relevant container logs here 19 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f /config/config.json ]; then 4 | cp /home/nobody/config.json /config/config.json 5 | fi 6 | 7 | ./t-rex --api-generate-key $API_PASSWORD -c /config/config.json & 8 | 9 | echo Starting T-rex miner... 10 | echo ============================================================ 11 | echo Server: $SERVER 12 | echo Algorithm: $ALGO 13 | echo Wallet: $WALLET 14 | echo Worker: $WORKER 15 | echo Pass: $PASS 16 | echo Extra: $EXTRA 17 | echo ============================================================ 18 | 19 | 20 | ./t-rex -c /config/config.json -a $ALGO -o $SERVER -u $WALLET -p $PASS -w $WORKER $EXTRA 21 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:11.4.2-base-ubuntu20.04 2 | 3 | ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" 4 | 5 | ENV WALLET=0x4208E04E6cAC8f496596fbfAFdF140382275C495 6 | ENV SERVER=stratum+ssl://us2.ethermine.org:5555 7 | ENV WORKER=Rig 8 | ENV ALGO=ethash 9 | ENV PASS=x 10 | ENV API_PASSWORD=Password1 11 | 12 | ENV TREX_URL="https://github.com/trexminer/T-Rex/releases/download/0.26.8/t-rex-0.26.8-linux.tar.gz" 13 | 14 | ADD config/config.json /home/nobody/ 15 | 16 | RUN apt-get update && apt-get install -y --no-install-recommends \ 17 | wget libnvidia-ml-dev \ 18 | && rm -rf /var/lib/apt/lists/* \ 19 | && mkdir /trex \ 20 | && wget --no-check-certificate $TREX_URL \ 21 | && tar -xvf ./*.tar.gz -C /trex \ 22 | && rm *.tar.gz 23 | 24 | WORKDIR /trex 25 | 26 | ADD init.sh /trex/ 27 | 28 | VOLUME ["/config"] 29 | 30 | CMD ["/bin/bash", "init.sh"] 31 | -------------------------------------------------------------------------------- /Dockerfile.cuda10: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 nvidia/cuda:10.2-base-ubuntu18.04 2 | 3 | ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" 4 | 5 | ENV WALLET=0x4208E04E6cAC8f496596fbfAFdF140382275C495 6 | ENV SERVER=stratum+ssl://us2.ethermine.org:5555 7 | ENV WORKER=Rig 8 | ENV ALGO=ethash 9 | ENV PASS=x 10 | ENV API_PASSWORD=Password1 11 | 12 | ENV TREX_URL="https://github.com/trexminer/T-Rex/releases/download/0.24.2/t-rex-0.24.2-linux.tar.gz" 13 | 14 | ADD config/config.json /home/nobody/ 15 | 16 | RUN apt-get update && apt-get install -y --no-install-recommends \ 17 | wget \ 18 | && rm -rf /var/lib/apt/lists/* \ 19 | && mkdir /trex \ 20 | && wget --no-check-certificate $TREX_URL \ 21 | && tar -xvf ./*.tar.gz -C /trex \ 22 | && rm *.tar.gz 23 | 24 | WORKDIR /trex 25 | 26 | ADD init.sh /trex/ 27 | 28 | VOLUME ["/config"] 29 | 30 | CMD ["/bin/bash", "init.sh"] 31 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Publish Docker image 2 | on: 3 | release: 4 | types: [published] 5 | push: 6 | branches: gh-actions 7 | jobs: 8 | cuda-11: 9 | name: Push CUDA 11 image to GHCR 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check out the repo 13 | uses: actions/checkout@v2 14 | - uses: docker/setup-buildx-action@v1 15 | - name: Docker meta 16 | id: meta 17 | uses: docker/metadata-action@v3 18 | with: 19 | images: ptrfrll/nv-docker-trex,ghcr.io/ptrfrll/nv-docker-trex 20 | tags: | 21 | type=ref,event=tag 22 | flavor: | 23 | latest=true 24 | - name: Login to GHCR 25 | uses: docker/login-action@v1 26 | with: 27 | registry: ghcr.io 28 | username: ${{ github.repository_owner }} 29 | password: ${{ secrets.GITHUB_TOKEN }} 30 | - name: Login to Dockerhub 31 | uses: docker/login-action@v1 32 | with: 33 | username: ${{ secrets.DOCKERHUB_USERNAME }} 34 | password: ${{ secrets.DOCKERHUB_TOKEN }} 35 | - name: Push and Build 36 | uses: docker/build-push-action@v2 37 | with: 38 | push: true 39 | file: Dockerfile 40 | tags: ${{ steps.meta.outputs.tags }} 41 | cuda-10: 42 | name: Push CUDA 10 image to GHCR 43 | runs-on: ubuntu-latest 44 | steps: 45 | - name: Check out the repo 46 | uses: actions/checkout@v2 47 | - uses: docker/setup-buildx-action@v1 48 | - name: Docker meta 49 | id: meta 50 | uses: docker/metadata-action@v3 51 | with: 52 | images: ptrfrll/nv-docker-trex,ghcr.io/ptrfrll/nv-docker-trex 53 | tags: | 54 | type=ref,event=tag 55 | type=raw,value=latest 56 | flavor: | 57 | latest=false 58 | prefix=cuda10- 59 | - name: Login to GHCR 60 | uses: docker/login-action@v1 61 | with: 62 | registry: ghcr.io 63 | username: ${{ github.repository_owner }} 64 | password: ${{ secrets.GITHUB_TOKEN }} 65 | - name: Login to Dockerhub 66 | uses: docker/login-action@v1 67 | with: 68 | username: ${{ secrets.DOCKERHUB_USERNAME }} 69 | password: ${{ secrets.DOCKERHUB_TOKEN }} 70 | - name: Push and Build 71 | uses: docker/build-push-action@v2 72 | with: 73 | push: true 74 | file: Dockerfile.cuda10 75 | tags: ${{ steps.meta.outputs.tags }} 76 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # T-Rex Miner Nvidia Docker 2 | 3 | ![Publish Docker image](https://github.com/PTRFRLL/nv-docker-trex/workflows/Publish%20Docker%20image/badge.svg) 4 | [![Donate with Ethereum](https://en.cryptobadges.io/badge/micro/0x4208E04E6cAC8f496596fbfAFdF140382275C495)](https://en.cryptobadges.io/donate/0x4208E04E6cAC8f496596fbfAFdF140382275C495) 5 | 6 | > Mine ethash (and others) on docker/nvidia-docker 7 | 8 | ## About 9 | 10 | This docker was specficially made for running on an Unraid system that uses LinuxServer's [Unraid Nvidia](https://forums.unraid.net/topic/77813-plugin-linuxserverio-unraid-nvidia/) or the new [Nvidia-Driver](https://forums.unraid.net/topic/98978-plugin-nvidia-driver/?tab=comments#comment-913250) plug-in. 11 | 12 | That said, this docker does not require Unraid, it can be used on any system that uses [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) 13 | 14 | ## Miner 15 | 16 | Currently uses [T-Rex Miner](https://github.com/trexminer/T-Rex) for mining. 17 | 18 | ## Getting Started 19 | 20 | ### Unraid 21 | 22 | Search for `trex miner` on the Community Applications page: 23 | 24 | ![community apps](examples/ca.png) 25 | 26 | Run `nvidia-smi` on Unraid console to determine CUDA version: 27 | 28 | ![cuda version](examples/cuda.png) 29 | 30 | **If using CUDA 10, use the cuda10 tag:** 31 | 32 | ``` 33 | ptrfrll/nv-docker-trex:cuda10 34 | ``` 35 | 36 | ### Specify GPU 37 | 38 | If you have multiple GPUs and only want to use specific ones for mining, you can add the `NVIDIA_VISIBLE_DEVICES` env variable to the Docker. 39 | Add a comma separated list of your GPU UUIDs you want to mine with as the value. 40 | 41 | ![nvidia](examples/nvidia.png) 42 | 43 | Here's a [great example by SpaceInvader](https://youtu.be/GOhHiFAXwOE?t=430) (here he's doing it for an Emby container but the process is the same) 44 | 45 | ### Docker 46 | 47 | Simply pull and run docker and add the needed variables: 48 | 49 | **NOTE**: If you don't change the default wallet, you'll be mining for me... :grin: 50 | 51 | | Variable | Value | Default | 52 | | ------------ | ------------------------ | ------------------------------------ | 53 | | WALLET | Your wallet address | My ETH wallet | 54 | | SERVER | Mining pool URL | stratum+ssl://us2.ethermine.org:5555 | 55 | | WORKER | Worker name | Rig | 56 | | ALGO | t-rex algorithm to mine | ethash | 57 | | PASS | Password for mining pool | x | 58 | | API_PASSWORD | Password for T-rex WebUI | Password1 | 59 | 60 | If you want to use the config file, map the `/config` path as well 61 | 62 | **Example**: 63 | 64 | ``` 65 | docker run -d --name='trex-miner' -e WALLET=0xYOUR_ETH_WALLET_ADDRESS -e SERVER=stratum+ssl://us2.ethermine.org:5555 -e WORKER=Rig -e ALGO=ethash -p '4067:4067/tcp' --runtime=nvidia ptrfrll/nv-docker-trex 66 | ``` 67 | 68 | **With Config File**: 69 | 70 | ``` 71 | docker run -d --name='trex-miner' -e WALLET=0xYOUR_ETH_WALLET_ADDRESS -e SERVER=stratum+ssl://us2.ethermine.org:5555 -e WORKER=Rig -e ALGO=ethash -p '4067:4067/tcp' -v '/path/to/config/':'/config':rw --runtime=nvidia ptrfrll/nv-docker-trex 72 | ``` 73 | --------------------------------------------------------------------------------