-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
127 lines (92 loc) · 3.79 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
FROM ubuntu:20.04 as download
ARG TARGETARCH
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends ca-certificates curl \
&& cd /opt/ \
&& curl -sOL https://github.com/krallin/tini/releases/download/v0.19.0/tini-$TARGETARCH \
&& chmod +x tini* \
&& curl -sOL https://github.com/tianon/gosu/releases/download/1.14/gosu-$TARGETARCH \
&& chmod +x gosu*
COPY / /opt
RUN find /opt/ -name "hpool-miner*" | xargs -i /bin/mv {} /opt/ \
&& cd /opt/ \
&& ls -al
FROM alpine:3.12 as timezone
Run apk update && apk add tzdata
FROM kayuii/amdgpu:v22.20.3 as opencl
ENV PATH=$PATH:/opt
ENV TZ=Asia/Shanghai
WORKDIR /opt
COPY --from=timezone /usr/share/zoneinfo/$TZ /etc/localtime
COPY --from=download /opt/hpool-miner-ironfish-opencl /opt/hpool-miner
COPY --from=download /opt/tini* /opt/tini
COPY --from=download /opt/gosu* /opt/gosu
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends ca-certificates curl \
&& groupadd -r miner \
&& useradd -r -m -g miner miner \
&& usermod -a -G render,users,miner miner \
&& echo $TZ > /etc/timezone \
&& ls -al /opt/ \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
COPY docker-entrypoint.sh /opt/entrypoint.sh
ENTRYPOINT ["tini", "--", "entrypoint.sh"]
CMD ["hpool-miner"]
FROM nvidia/cuda:11.7.1-base-ubuntu20.04 as cuda
# FROM nvidia/cuda:11.4.3-base-ubuntu20.04 as cuda
# cuda 11.7 hashrate greater than 11.4
ENV PATH=$PATH:/opt
ENV TZ=Asia/Shanghai
WORKDIR /opt
COPY --from=timezone /usr/share/zoneinfo/$TZ /etc/localtime
COPY --from=download /opt/hpool-miner-ironfish-cuda /opt/hpool-miner
COPY --from=download /opt/tini* /opt/tini
COPY --from=download /opt/gosu* /opt/gosu
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends ca-certificates curl \
&& groupadd -r miner \
&& useradd -r -m -g miner miner \
&& usermod -a -G users,miner miner \
&& echo $TZ > /etc/timezone \
&& ls -al /opt/ \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
COPY docker-entrypoint.sh /opt/entrypoint.sh
ENTRYPOINT ["tini", "--", "entrypoint.sh"]
CMD ["hpool-miner"]
FROM nvidia/cuda:11.7.1-base-ubuntu20.04 as cuda-rocm
ARG ROCM_VERSION=5.2.3
ARG AMDGPU_VERSION=22.20.3
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl libnuma-dev gnupg \
&& curl -sL https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \
&& printf "deb [arch=amd64] https://repo.radeon.com/rocm/apt/$ROCM_VERSION/ ubuntu main" | tee /etc/apt/sources.list.d/rocm.list \
&& printf "deb [arch=amd64] https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/ubuntu focal main" | tee /etc/apt/sources.list.d/amdgpu.list \
&& apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
rocm-smi \
rocminfo \
rocm-opencl-runtime && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN groupadd -g 109 render
FROM cuda-rocm as all-in-one
ENV PATH=$PATH:/opt
ENV TZ=Asia/Shanghai
WORKDIR /opt
COPY --from=timezone /usr/share/zoneinfo/$TZ /etc/localtime
COPY --from=download /opt/hpool-miner-ironfish-opencl /opt/hpool-miner-ironfish-opencl
COPY --from=download /opt/hpool-miner-ironfish-cuda /opt/hpool-miner-ironfish-cuda
COPY --from=download /opt/tini* /opt/tini
COPY --from=download /opt/gosu* /opt/gosu
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends ca-certificates curl \
&& groupadd -r miner \
&& useradd -r -m -g miner miner \
&& usermod -a -G render,users,miner miner \
&& echo $TZ > /etc/timezone \
&& ls -al /opt/ \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
COPY docker-entrypoint-switch.sh /opt/entrypoint.sh
ENTRYPOINT ["tini", "--", "entrypoint.sh"]
CMD ["hpool-miner"]