-
Notifications
You must be signed in to change notification settings - Fork 48
/
Dockerfile
86 lines (75 loc) · 2.75 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
75
76
77
78
79
80
81
82
83
84
85
86
FROM ubuntu:22.04 as build-cuda-plugin
LABEL maintainer="Patrice Ferlet <[email protected]>"
ARG CUDA_VERSION=11-4
RUN set -xe; \
apt-get update; \
apt-get install -y nvidia-cuda-toolkit;
ARG CUDA_PLUGIN_VERSION=6.22.0
RUN set -xe; \
apt-get install -y wget build-essential cmake automake libtool autoconf; \
apt-get install -y gcc-9 g++-9; \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100; \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100; \
wget https://github.com/xmrig/xmrig-cuda/archive/refs/tags/v${CUDA_PLUGIN_VERSION}.tar.gz; \
tar xf v${CUDA_PLUGIN_VERSION}.tar.gz; \
mv xmrig-cuda-${CUDA_PLUGIN_VERSION} xmrig-cuda; \
cd xmrig-cuda; \
mkdir build; \
cd build; \
cmake .. -DCUDA_LIB=/usr/lib/x86_64-linux-gnu/stubs/libcuda.so -DCUDA_TOOLKIT_ROOT_DIR=/usr/lib/x86_64-linux-gnu -DCUDA_ARCH="75;80"; \
make -j $(nproc);
FROM ubuntu:22.04 as build-runner
ARG XMRIG_VERSION=6.22.0
LABEL maintainer="Patrice Ferlet <[email protected]>"
RUN set -xe; \
apt-get update; \
apt-get install -y wget build-essential cmake automake libtool autoconf; \
apt-get install -y gcc-9 g++-9; \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100; \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100; \
rm -rf /var/lib/apt/lists/*; \
wget https://github.com/xmrig/xmrig/archive/refs/tags/v${XMRIG_VERSION}.tar.gz; \
tar xf v${XMRIG_VERSION}.tar.gz; \
mv xmrig-${XMRIG_VERSION} /xmrig; \
cd /xmrig; \
mkdir build; \
cd scripts; \
./build_deps.sh; \
cd ../build; \
cmake .. -DXMRIG_DEPS=scripts/deps; \
make -j $(nproc);
RUN set -xe; \
cd /xmrig; \
cp build/xmrig /xmrig
FROM ubuntu:22.04 as runner
LABEL maintainer="Patrice Ferlet <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/metal3d/docker-xmrig"
LABEL org.opencontainers.image.description="XMRig miner with CUDA support on Docker, Podman, Kubernetes..."
LABEL org.opencontainers.image.licenses="MIT"
RUN set -xe; \
mkdir /xmrig; \
apt-get update; \
apt-get -y install jq; \
apt-get -y install libnvidia-compute-535 libnvrtc11.2; \
rm -rf /var/lib/apt/lists/*
COPY --from=build-runner /xmrig/xmrig /xmrig/xmrig
COPY --from=build-runner /xmrig/src/config.json /xmrig/config.json
COPY --from=build-cuda-plugin /xmrig-cuda/build/libxmrig-cuda.so /usr/local/lib/
ENV POOL_USER="44vjAVKLTFc7jxTv5ij1ifCv2YCFe3bpTgcRyR6uKg84iyFhrCesstmWNUppRCrxCsMorTP8QKxMrD3QfgQ41zsqMgPaXY5" \
POOL_PASS="" \
POOL_URL="xmr.metal3d.org:8080" \
DONATE_LEVEL=5 \
PRIORITY=0 \
THREADS=0 \
PATH="/xmrig:${PATH}" \
CUDA=false \
CUDA_BF="" \
ALGO="" \
COIN="" \
THREAD_DIVISOR="2"
WORKDIR /xmrig
COPY entrypoint.sh /entrypoint.sh
WORKDIR /tmp
EXPOSE 3000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["xmrig"]