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