-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
48 lines (36 loc) · 1.58 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
# Multistage docker build, requires docker 17.05
# builder stage
FROM nvidia/cuda:10.0-devel as builder
RUN set -ex && \
apt-get update && \
apt-get --no-install-recommends --yes install \
libncurses5-dev \
libncursesw5-dev \
cmake \
git \
curl \
libssl-dev \
pkg-config
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN git clone https://github.com/mimblewimble/grin-miner && cd grin-miner && git submodule update --init
#RUN cd grin-miner && sed -i 's/^\(cuckoo_miner.*\)}/\1, features = ["build-cuda-plugins"] }/' Cargo.toml
RUN cd grin-miner && $HOME/.cargo/bin/cargo build --release
RUN cd grin-miner && curl https://gist.githubusercontent.com/Clearwood/60294c02702b6995e719ce8a1d4df218/raw/install.sh > install.sh
# runtime stage
FROM nvidia/cuda:10.0-base
RUN set -ex && \
apt-get update && \
apt-get --no-install-recommends --yes install \
libncurses5 \
libncursesw5 \
vim
COPY --from=builder /grin-miner/target/release/grin-miner /root/target/release/grin-miner
COPY --from=builder /grin-miner/target/release/plugins/* /root/target/release/plugins/
COPY --from=builder /grin-miner/grin-miner.toml /root/grin-miner.toml
COPY --from=builder /grin-miner/install.sh /root/install.sh
WORKDIR /root
RUN sed -i 's/stratum_server_addr.*/stratum_server_addr = "eu-west-stratum.grinmint.com:4416"/' grin-miner.toml
RUN sed -i 's/stratum_server_tls_enabled.*/stratum_server_tls_enabled = true/' grin-miner.toml
RUN chmod a+x install.sh
RUN echo '/root/target/release/grin-miner' >> onstart.sh
RUN chmod +x onstart.sh