The code is adapted from https://github.com/Anthony-Tatowicz/docker-ethminer.
Make sure you have 1) Docker and 2) Nvidia runtime installed then you are good to go.
The code is adapted from https://github.com/Anthony-Tatowicz/docker-ethminer.
Make sure you have 1) Docker and 2) Nvidia runtime installed then you are good to go.
| FROM nvidia/cuda:11.2.1-devel | |
| MAINTAINER Chin-Yun Yu | |
| WORKDIR / | |
| ENV TZ=Asia/Taipei | |
| RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
| # Package and dependency setup | |
| RUN apt-get update \ | |
| && apt-get -y install software-properties-common \ | |
| && add-apt-repository -y ppa:ethereum/ethereum -y \ | |
| && apt-get update \ | |
| && apt-get install -y git \ | |
| cmake \ | |
| ethereum | |
| # Git repo set up | |
| RUN git clone https://github.com/ethereum-mining/ethminer.git; \ | |
| cd ethminer; \ | |
| git submodule update --init --recursive | |
| # Build | |
| RUN cd ethminer; \ | |
| mkdir build; \ | |
| cd build; \ | |
| cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF -DETHSTRATUM=ON; \ | |
| cmake --build .; \ | |
| make install; | |
| # Env setup | |
| ENV GPU_FORCE_64BIT_PTR=0 | |
| ENV GPU_MAX_HEAP_SIZE=100 | |
| ENV GPU_USE_SYNC_OBJECTS=1 | |
| ENV GPU_MAX_ALLOC_PERCENT=100 | |
| ENV GPU_SINGLE_ALLOC_PERCENT=100 | |
| ENTRYPOINT ["/usr/local/bin/ethminer", "-U"] |