-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.arm64v8
64 lines (52 loc) · 2.28 KB
/
Dockerfile.arm64v8
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
FROM alpine AS qemu
# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261
ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz
RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1
FROM arm64v8/debian:10 as builder
COPY --from=qemu qemu-aarch64-static /usr/bin
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get -q -y update && \
apt-get -q -y install wget \
curl \
git \
unzip \
build-essential \
golang && \
apt-get -q -y clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
\
git clone https://github.com/binance-chain/bsc /bsc && \
cd /bsc && \
make geth && \
cd / && \
\
wget $(curl -s https://api.github.com/repos/binance-chain/bsc/releases/latest |grep browser_ |grep mainnet |cut -d\" -f4) && \
wget $(curl -s https://api.github.com/repos/binance-chain/bsc/releases/latest |grep browser_ |grep testnet |cut -d\" -f4) && \
\
cp /bsc/build/bin/geth /usr/bin/geth && \
tar cvf /transfer.tar /usr/bin/geth /*.zip
FROM arm64v8/debian:10
COPY --from=qemu qemu-aarch64-static /usr/bin
ENV NETWORK=main
COPY --from=builder /transfer.tar /transfer.tar
RUN cd / \
&& tar xvf /transfer.tar \
&& rm /transfer.tar && \
\
export DEBIAN_FRONTEND=noninteractive && \
apt-get -q -y update && \
apt-get -q -y install unzip && \
apt-get -q -y clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# NODE P2P
EXPOSE 30311/udp
EXPOSE 30311/tcp
# pprof / metrics
EXPOSE 6060/tcp
# HTTP based JSON RPC API
EXPOSE 8545/tcp
# WebSocket based JSON RPC API
EXPOSE 8546/tcp
# GraphQL API
EXPOSE 8547/tcp
CMD sh -xc "cd /data; [ ! -f '/data/genesis.json' ] && unzip /$NETWORK'net.zip' && geth --datadir . init genesis.json && sed -i '/^HTTP/d' ./config.toml; exec geth --config ./config.toml --datadir . --pprof --pprofaddr 0.0.0.0 --metrics --rpc --rpcapi eth,net,web3,txpool,parlia --rpccorsdomain '*' --rpcvhosts '*' --rpcaddr 0.0.0.0 --rpcport 8545 --ws --wsapi eth,net,web3 --wsorigins '*' --wsaddr 0.0.0.0 --wsport 8546 --graphql --graphql.addr 0.0.0.0 --graphql.port 8587 --graphql.corsdomain '*' --graphql.vhosts '*'"