Dockerfile 731 B

1234567891011121314151617181920
  1. FROM alpine:3.13.1
  2. # > All command-line options (except for '-datadir' and '-conf') may be specified in a configuration file
  3. ENV DATA_DIR_PATH=/var/lib/bitcoin
  4. ARG BITCOIN_CORE_PACKAGE_VERSION=0.20.1-r1
  5. # > Executing bitcoin-0.19.1-r0.post-install
  6. # > Generated random user / password / port in: /etc/bitcoin.conf
  7. RUN apk add --no-cache \
  8. bitcoin=$BITCOIN_CORE_PACKAGE_VERSION \
  9. bitcoin-cli=$BITCOIN_CORE_PACKAGE_VERSION \
  10. && rm /etc/bitcoin.conf \
  11. && mkdir "$DATA_DIR_PATH" \
  12. && chown -c bitcoin "$DATA_DIR_PATH"
  13. VOLUME $DATA_DIR_PATH
  14. USER bitcoin
  15. EXPOSE 8333/tcp
  16. # json-rpc api
  17. EXPOSE 8332/tcp
  18. CMD ["sh", "-c", "exec bitcoind -datadir=\"$DATA_DIR_PATH\" -rpcbind=0.0.0.0 -rpcallowip=172.16.0.0/12"]