Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM nvidia/cuda:11.3.0-devel-ubuntu18.04 AS build
  2. RUN apt-get update && apt-get install -y git perl python3-pip mesa-common-dev libdbus-1-dev software-properties-common
  3. RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
  4. RUN apt-get update && apt-get install -y g++-10
  5. RUN pip3 install cmake --upgrade
  6. RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
  7. RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
  8. WORKDIR /app
  9. # Copying only .git files to init submodule to be able to use docker cache more
  10. COPY .git .git
  11. COPY .gitmodules .gitattributes ./
  12. RUN git submodule update --init --recursive
  13. # Copying everything
  14. COPY . .
  15. RUN mkdir build
  16. WORKDIR /app/build
  17. ARG DETHASHCUDA=ON
  18. ARG DETHASHCL=ON
  19. RUN cmake .. -DETHASHCUDA=$DETHASHCUDA -DETHASHCL=$DETHASHCL
  20. RUN cmake --build .
  21. # For run nvidia container toolkit needs to be installed on host
  22. # How to: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker
  23. # Run docker: docker build -t nsfminer . && docker run --gpus all -e POOL="stratum+tcp://ikru.eth:x@us-east.ethash-hub.miningpoolhub.com:20535" nsfminer
  24. FROM nvidia/cuda:11.3.0-base-ubuntu18.04
  25. ENV POOL="Pool connection"
  26. WORKDIR /app
  27. COPY --from=build /app/ ./
  28. CMD nvidia-smi && ./build/nsfminer/nsfminer -U -P "${POOL}"