-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
42 lines (31 loc) · 985 Bytes
/
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
FROM --platform=linux/amd64 alpine:3.12 as builder
ARG VER=v1.5.0-2
ARG TARGETARCH
ARG ARCH
ENV PATH=$PATH:/opt
ENV TZ=Asia/Shanghai
COPY arch.sh /tmp/arch.sh
RUN apk --no-cache add bash tzdata \
&& mkdir -p /tmp/linux \
&& /tmp/arch.sh ${VER} \
&& mv /tmp/linux/* /opt/ \
&& cp /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& cat /etc/timezone \
&& rm -rf /tmp/* \
&& apk del tzdata
FROM ubuntu:20.04
RUN groupadd -r chia && useradd -r -m -g chia chia && usermod -a -G users,chia chia
ENV PATH=$PATH:/opt
WORKDIR /opt
COPY --from=builder /etc/localtime /etc
COPY --from=builder /etc/timezone /etc
COPY --from=builder /opt/hpool-* /opt
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends ca-certificates curl gosu tini \
&& cd /opt/ \
&& mv hpool-* hpool-chiapp-miner \
&& ls -al /opt/
COPY docker-entrypoint.sh /opt/entrypoint.sh
ENTRYPOINT ["tini", "--", "entrypoint.sh"]
CMD ["hpool-chiapp-miner"]