forked from s1na/hive
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
54 lines (42 loc) · 1.96 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
# Docker container spec for building the master branch of go-ethereum.
#
# The build process it potentially longer running but every effort was made to
# produce a very minimalistic container that can be reused many times without
# needing to constantly rebuild.
ARG branch=latest
FROM ethereum/client-go:$branch
RUN apk add --update bash curl jq
# FROM alpine:latest
# ARG branch=master
# Build go-ethereum on the fly and delete all build tools afterwards
# RUN \
# apk add --update bash curl jq go git make gcc musl-dev \
# ca-certificates linux-headers && \
# git clone --depth 1 --branch $branch https://github.com/ethereum/go-ethereum && \
# (cd go-ethereum && make geth) && \
# (cd go-ethereum && \
# echo "{}" \
# | jq ".+ {\"repo\":\"$(git config --get remote.origin.url)\"}" \
# | jq ".+ {\"branch\":\"$(git rev-parse --abbrev-ref HEAD)\"}" \
# | jq ".+ {\"commit\":\"$(git rev-parse HEAD)\"}" \
# > /version.json) && \
# cp go-ethereum/build/bin/geth /geth && \
# apk del go git make gcc musl-dev linux-headers && \
# rm -rf /go-ethereum && rm -rf /var/cache/apk/*
# TODO, make this work again
RUN echo "{\"repo\":\"\", \"branch\":\"\", \"commit\":\"\"}" > /version.json
# Inject the startup script
ADD geth.sh /geth.sh
ADD mapper.jq /mapper.jq
RUN chmod +x /geth.sh
# Inject the enode id retriever script
ADD enode.sh /enode.sh
RUN chmod +x /enode.sh
ADD genesis.json /genesis.json
# Export the usual networking ports to allow outside access to the node
EXPOSE 8545 8546 8547 30303 30303/udp
# Generate the ethash verification caches
RUN \
/usr/local/bin/geth makecache 1 ~/.ethereum/geth/ethash && \
/usr/local/bin/geth makecache 30001 ~/.ethereum/geth/ethash
ENTRYPOINT ["/geth.sh"]