forked from akash-network/awesome-akash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
74 lines (64 loc) · 2.06 KB
/
Dockerfile
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
73
74
# Use NVIDIA CUDA base image
FROM nvidia/cuda:11.8.0-devel-ubuntu20.04
LABEL authors="Andrew Mello"
LABEL maintainer="[email protected]"
LABEL website="https://cryptoandcoffee.com"
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV POOL="gulf.moneroocean.stream:10128"
ENV WALLET_ADDRESS="4AbG74FRUHYXBLkvqM1f7QH3UXGkhLetKdxS7U7BHkyfMF4nfx99GvN1REwYQHAeVLLy4Qa5gXXkfS4pSHHUWwdVFifDo5K"
ENV OPTIONS="--verbose --no-color --cuda --no-cpu --bench-algo-time 10 --syslog"
# Install system dependencies
RUN apt update && \
apt -y install \
msr-tools \
kmod \
psmisc \
numactl \
libbz2-dev \
wget \
jq \
curl \
xz-utils \
nvidia-opencl-dev \
libhwloc-dev \
libuv1-dev \
libssl-dev \
git \
build-essential \
cmake \
automake \
libtool \
autoconf \
bc \
util-linux && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Clone, build and install XMRig
RUN git clone https://github.com/moneroocean/xmrig && \
cd xmrig && \
sed -i 's/constexpr const int kDefaultDonateLevel = 1;/constexpr const int kDefaultDonateLevel = 0;/g' src/donate.h && \
sed -i 's/constexpr const int kMinimumDonateLevel = 1;/constexpr const int kMinimumDonateLevel = 0;/g' src/donate.h && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. -DWITH_OPENCL=OFF && \
make -j$(nproc)
# Clone, build and install XMRig-CUDA
RUN git clone https://github.com/moneroocean/xmrig-cuda.git && \
cd xmrig-cuda && \
mkdir build && \
cd build && \
cmake .. \
-DCUDA_LIB=/usr/local/cuda/lib64/stubs/libcuda.so \
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda && \
make -j$(nproc)
# Copy run script
COPY ./run.sh /xmrig/
# Set execute permissions
RUN chmod +x /xmrig/run.sh
# Move libxmrig-cuda and xmrig to /xmrig
RUN cp /xmrig-cuda/build/libxmrig-cuda.so /xmrig/
RUN mv /xmrig/build/xmrig /xmrig/
COPY config.json /xmrig/
# Command to run
ENTRYPOINT ["/xmrig/run.sh"]