Dockerfile 667 B

123456789101112131415161718
  1. FROM alpine:3.12
  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.19.1-r0
  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 bitcoin=$BITCOIN_CORE_PACKAGE_VERSION \
  8. && rm /etc/bitcoin.conf \
  9. && mkdir "$DATA_DIR_PATH" \
  10. && chown -c bitcoin "$DATA_DIR_PATH"
  11. VOLUME $DATA_DIR_PATH
  12. USER bitcoin
  13. EXPOSE 8333/tcp
  14. # json-rpc api
  15. EXPOSE 8332/tcp
  16. CMD ["sh", "-c", "exec bitcoind -datadir=\"$DATA_DIR_PATH\" -rpcbind=0.0.0.0 -rpcallowip=172.16.0.0/12"]