This repository has been archived by the owner on Dec 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile.gpuminer
72 lines (59 loc) · 2.08 KB
/
Dockerfile.gpuminer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM nvidia/cuda:11.0-devel-ubuntu18.04 AS builder
# Get basic packages
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
autoconf \
automake \
build-essential \
curl \
wget \
git \
python3 \
python3-dev \
python3-pip \
python3-wheel \
python3-numpy \
ca-certificates \
golang \
nano \
cmake \
libboost-all-dev \
libtool \
libprotobuf-dev \
protobuf-compiler \
locales \
pkg-config \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Fetch grpc
ARG GRPC_RELEASE=1.24.2
RUN git clone -b v${GRPC_RELEASE} https://github.com/grpc/grpc /var/local/git/grpc && \
cd /var/local/git/grpc && \
git submodule update --init --recursive
RUN mkdir -p /var/local/git/grpc/build && cd /var/local/git/grpc/build && cmake .. && make -j $(nproc) && make install
ENV PATH="/var/local/git/grpc/build:${PATH}"
ARG CACHEBUST=1
# Compile LG's CUDA grpc miner
ARG BRANCH_NAME=cuda-miner
RUN git clone -b ${BRANCH_NAME} https://github.com/trick77/bc-src /var/local/git/bc-src && \
cd /var/local/git/bc-src/cuda-miner
RUN cd /var/local/git/bc-src/cuda-miner/src && make -f ../Makefile
# ------------------------------------------------------------------------------
FROM nvidia/cuda:11.0-base-ubuntu18.04
# Install required packages
RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev && \
apt-get clean && rm -rf /var/lib/apt/lists
# Copy grpc libraries from builder image to /usr/local/lib
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/lib /usr/local/lib
COPY --from=builder /var/local/git/grpc/build/*.a /usr/local/lib/
RUN mkdir /cuda-miner
WORKDIR /cuda-miner
# Copy miner binary from the builder image
COPY --from=builder /var/local/git/bc-src/cuda-miner/src/miner ./
COPY gpuminer/wrapper.sh ./
# Make sure miner finds CUDA libraries
ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/local/cuda/lib64:/usr/local/cuda/compat:${LD_LIBRARY_PATH}"
EXPOSE 50052
CMD [ "/cuda-miner/wrapper.sh" ]