commit 8e970659b5928d448a08c8d36044a03469b0c60b Author: Luke Childs Date: Fri Nov 8 11:43:17 2019 +0700 Initial commit diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..239a327 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +sudo: required +services: + - docker +script: docker build -t vertcoind . && ( docker run vertcoind -version | tee /dev/stderr | grep -q $(cat VERSION) ) 2>&1 +notifications: + email: + on_success: never diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..43904d7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:stable-slim +LABEL maintainer="Luke Childs " + +COPY ./bin /usr/local/bin +COPY ./VERSION /tmp + +RUN VERSION=`cat /tmp/VERSION` && \ + chmod a+x /usr/local/bin/* && \ + apt-get update && \ + apt-get install -y --no-install-recommends curl ca-certificates && \ + curl -L https://bitcoin.org/bin/bitcoin-core-${VERSION}/bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz --output /tmp/prebuilt.tar.gz && \ + tar -zxvf /tmp/prebuilt.tar.gz -C /tmp && \ + mv /tmp/bitcoin-${VERSION}/bin/* /usr/local/bin/ && \ + apt-get purge -y curl ca-certificates && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +VOLUME ["/data"] +ENV HOME /data +ENV DATA /data +WORKDIR /data + +EXPOSE 8332 8333 + +ENTRYPOINT ["init"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f27ee9b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Luke Childs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2996044 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ + +# docker-bitcoind + +[![Build Status](https://travis-ci.org/lukechilds/docker-bitcoind.svg?branch=master)](https://travis-ci.org/lukechilds/docker-bitcoind) +[![Image Layers](https://images.microbadger.com/badges/image/lukechilds/bitcoind.svg)](https://microbadger.com/images/lukechilds/bitcoind) +[![Docker Pulls](https://img.shields.io/docker/pulls/lukechilds/bitcoind.svg)](https://hub.docker.com/r/lukechilds/bitcoind/) + +> Run a full Bitcoin node with one command + +A Docker configuration with sane defaults for running a full +Bitcoin node. + +## Usage + +``` +docker run -v /home/username/bitcoin:/data -p 8333:8333 lukechilds/bitcoind +``` + +If there's a `bitcoin.conf` in the `/data` volume it'll be used. If not, one will be created for you with a randomly generated JSON-RPC password. + +### JSON-RPC + +To access JSON-RPC you'll also need to expose port 8332. You probably only want this available to localhost: + +``` +docker run -v /home/username/bitcoin:/data -p 8333:8333 -p 127.0.0.1:8332:8332 lukechilds/bitcoind +``` + +### CLI Arguments + +All CLI arguments are passed directly through to bitcoind. + +You can use this to configure via CLI args without a config file: + +``` +docker run -v /home/username/bitcoin:/data \ + -p 8333:8333 \ + -p 127.0.0.1:8332:8332 \ + lukechilds/bitcoind -rpcuser=jonsnow -rpcpassword=ikn0wnothin +``` + +Or just use the container like a bitcoind binary: + +``` +$ docker run lukechilds/bitcoind -version +Bitcoin Core Daemon version v0.18.1 +Copyright (C) 2009-2019 The Bitcoin Core developers + +Please contribute if you find Bitcoin Core useful. Visit + for further information about the software. +The source code is available from . + +This is experimental software. +Distributed under the MIT software license, see the accompanying file COPYING +or + +This product includes software developed by the OpenSSL Project for use in the +OpenSSL Toolkit and cryptographic software written by +Eric Young and UPnP software written by Thomas Bernard. +``` + +### Version + +You can also run a specific version of bitcoind if you want. + +``` +docker run -v /home/username/bitcoin:/data -p 8333:8333 lukechilds/bitcoind:v0.11.1.0 +``` + +## License + +MIT © Luke Childs diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..249afd5 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.18.1 diff --git a/bin/init b/bin/init new file mode 100644 index 0000000..476660b --- /dev/null +++ b/bin/init @@ -0,0 +1,11 @@ +#!/bin/bash + +CONF=${DATA}/bitcoin.conf + +if [ ! -e "${CONF}" ]; then + echo "disablewallet=1 +printtoconsole=1 +rpcallowip=::/0" > "${CONF}" +fi + +exec bitcoind -datadir=${DATA} -conf=${CONF} "$@"