Skip to content

Instantly share code, notes, and snippets.

@mharsch
Last active February 6, 2021 15:55
Show Gist options
  • Select an option

  • Save mharsch/981ce81429e9012bb0efd0149f7556fd to your computer and use it in GitHub Desktop.

Select an option

Save mharsch/981ce81429e9012bb0efd0149f7556fd to your computer and use it in GitHub Desktop.
Get ethereum mining working on Ubuntu + NVIDIA Docker host
Make sure the host has up-to-date nvidia drivers (460 as of this writing)
sudo apt install nvidia-headless-460
Download ethminer to current directory:
wget https://github.com/ethereum-mining/ethminer/releases/download/v0.19.0-alpha.0/ethminer-0.19.0-alpha.0-cuda-9-linux-x86_64.tar.gz
Create Dockerfile as follows:
FROM nvidia/cuda:11.2.0-base-ubuntu18.04
LABEL description="ethminer container for NVIDIA GPU systems"
COPY ethminer-0.19.0-alpha.0-cuda-9-linux-x86_64.tar.gz /ethminer.tar.gz
ENV API_PORT=3333
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& mkdir -p /ethminer \
&& tar xvfz ethminer.tar.gz -C /ethminer \
&& rm ethminer.tar.gz \
&& apt-get purge --autoremove -y curl \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
EXPOSE $API_PORT
CMD /ethminer/bin/ethminer -U -R \
-P stratum1+ssl://$ETH_WALLET.$WORKERNAME@us2.ethermine.org:5555 \
-P stratum1+ssl://$ETH_WALLET.$WORKERNAME@us1.ethermine.org:5555
Build Docker image:
docker build -t nvethtainer .
Run the container (fill in your own wallet address and worker name)
docker run -d --gpus all --name miner1 -e ETH_WALLET=<your eth wallet address> -e WORKERNAME=<some name> nvethtainer
Monitor mining progress:
docker logs -f --tail 25 miner1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment