Created
March 1, 2018 20:23
-
-
Save javahippie/384cfe70ce1b26652b36a8c1e15ed689 to your computer and use it in GitHub Desktop.
Dockerfile for a mining Ethereum Node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:xenial | |
MAINTAINER Tim Zöller <mail@tim-zoeller.de> | |
RUN apt-get update \ | |
&& apt-get install -y wget \ | |
&& rm -rf /var/lib/apt/lists/* | |
WORKDIR "/opt" | |
ARG BINARY="geth-alltools-linux-amd64-1.8.1-1e67410e.tar.gz" | |
RUN wget "https://gethstore.blob.core.windows.net/builds/$BINARY" | |
RUN tar -xzvf $BINARY --strip 1 | |
RUN rm $BINARY | |
ADD ./genesis.json ./genesis.json | |
RUN ./geth init genesis.json | |
ARG password | |
ARG privatekey | |
RUN echo $password > ~/.accountpassword | |
RUN echo $privatekey > ~/.privatekey | |
RUN ./geth account import --password ~/.accountpassword ~/.privatekey | |
ENV address="" | |
ENV bootnodeId="" | |
ENV bootnodeIp="" | |
CMD exec ./geth --bootnodes "enode://$bootnodeId@$bootnodeIp:30301" --networkid="500" --verbosity=4 --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --mine --etherbase $address --unlock $address --password ~/.accountpassword | |
EXPOSE 8545 | |
EXPOSE 30303 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment