This commit is contained in:
Jeffrey Paul 2016-08-18 12:51:04 +02:00
parent 1dc40402e9
commit 8fd08d1373
Signed by: sneak
GPG Key ID: 052443F4DF2A55C2
4 changed files with 19 additions and 18 deletions

View File

@ -3,6 +3,7 @@ FROM phusion/baseimage:0.9.19
ENV BITCOIND_REV master
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
ARG BITCOIN_REPO=https://github.com/bitcoin/bitcoin.git
RUN sed -i \
-e s#http://archive.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \
@ -35,9 +36,9 @@ RUN \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN git clone https://github.com/bitcoin/bitcoin.git /usr/local/src/bitcoin
RUN cd /usr/local/src/bitcoin && \
RUN \
git clone $BITCOIN_REPO /usr/local/src/bitcoin && \
cd /usr/local/src/bitcoin && \
git checkout $BITCOIND_REV && \
./autogen.sh && \
./configure --disable-wallet --enable-hardening && \
@ -59,21 +60,21 @@ RUN \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV HOME /var/lib/bitcoin
RUN useradd -s /bin/bash -m -d /var/lib/bitcoin bitcoin
RUN chown bitcoin:bitcoin -R /var/lib/bitcoin
ENV HOME /var/lib/bitcoind
RUN useradd -s /bin/bash -m -d /var/lib/bitcoind bitcoind
RUN chown bitcoind:bitcoind -R /var/lib/bitcoind
VOLUME ["/var/lib/bitcoin"]
VOLUME ["/var/lib/bitcoind"]
EXPOSE 8332
EXPOSE 8333
RUN mkdir -p /etc/service/bitcoin
ADD bitcoin.run /etc/service/bitcoin/run
RUN mkdir -p /etc/service/bitcoind
ADD bitcoind.run /etc/service/bitcoind/run
RUN mkdir -p /etc/service/bitcoin/log
ADD bitcoin.log.run /etc/service/bitcoin/log/run
RUN mkdir -p /etc/service/bitcoind/log
ADD bitcoind.log.run /etc/service/bitcoind/log/run
RUN chmod +x /etc/service/bitcoin/log/run \
/etc/service/bitcoin/run
RUN chmod +x /etc/service/bitcoind/log/run \
/etc/service/bitcoind/run

View File

@ -1,10 +1,10 @@
default: build
build: kill
docker build -t sneak/bitcoind:0.12.0 .
docker build -t sneak/bitcoind:master .
run: kill
docker run --name sneak-bitcoind -d sneak/bitcoind:0.12.0
docker run --name sneak-bitcoind -d sneak/bitcoind:master
docker logs -f sneak-bitcoind
kill:

View File

@ -1,6 +1,6 @@
#!/bin/bash
export HOME="/var/lib/bitcoin"
export HOME="/var/lib/bitcoind"
# gen random pw for rpc server
RANDOMPW=$(dd if=/dev/urandom bs=10 count=1 status=none | shasum | cut -b 1-20)
@ -26,9 +26,9 @@ if [[ ! -d $HOME/blocks ]]; then
fi
fi
chown -R bitcoin:bitcoin $HOME
chown -R bitcoind:bitcoind $HOME
exec chpst -ubitcoin \
exec chpst -ubitcoind \
bitcoind $ARGS \
$BITCOIND_EXTRA_OPTS \
2>&1