updates
This commit is contained in:
parent
1dc40402e9
commit
8fd08d1373
27
Dockerfile
27
Dockerfile
@ -3,6 +3,7 @@ FROM phusion/baseimage:0.9.19
|
|||||||
ENV BITCOIND_REV master
|
ENV BITCOIND_REV master
|
||||||
|
|
||||||
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
|
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
|
||||||
|
ARG BITCOIN_REPO=https://github.com/bitcoin/bitcoin.git
|
||||||
|
|
||||||
RUN sed -i \
|
RUN sed -i \
|
||||||
-e s#http://archive.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \
|
-e s#http://archive.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \
|
||||||
@ -35,9 +36,9 @@ RUN \
|
|||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
RUN git clone https://github.com/bitcoin/bitcoin.git /usr/local/src/bitcoin
|
RUN \
|
||||||
|
git clone $BITCOIN_REPO /usr/local/src/bitcoin && \
|
||||||
RUN cd /usr/local/src/bitcoin && \
|
cd /usr/local/src/bitcoin && \
|
||||||
git checkout $BITCOIND_REV && \
|
git checkout $BITCOIND_REV && \
|
||||||
./autogen.sh && \
|
./autogen.sh && \
|
||||||
./configure --disable-wallet --enable-hardening && \
|
./configure --disable-wallet --enable-hardening && \
|
||||||
@ -59,21 +60,21 @@ RUN \
|
|||||||
apt-get autoremove -y && \
|
apt-get autoremove -y && \
|
||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
ENV HOME /var/lib/bitcoin
|
ENV HOME /var/lib/bitcoind
|
||||||
RUN useradd -s /bin/bash -m -d /var/lib/bitcoin bitcoin
|
RUN useradd -s /bin/bash -m -d /var/lib/bitcoind bitcoind
|
||||||
RUN chown bitcoin:bitcoin -R /var/lib/bitcoin
|
RUN chown bitcoind:bitcoind -R /var/lib/bitcoind
|
||||||
|
|
||||||
VOLUME ["/var/lib/bitcoin"]
|
VOLUME ["/var/lib/bitcoind"]
|
||||||
|
|
||||||
EXPOSE 8332
|
EXPOSE 8332
|
||||||
|
|
||||||
EXPOSE 8333
|
EXPOSE 8333
|
||||||
|
|
||||||
RUN mkdir -p /etc/service/bitcoin
|
RUN mkdir -p /etc/service/bitcoind
|
||||||
ADD bitcoin.run /etc/service/bitcoin/run
|
ADD bitcoind.run /etc/service/bitcoind/run
|
||||||
|
|
||||||
RUN mkdir -p /etc/service/bitcoin/log
|
RUN mkdir -p /etc/service/bitcoind/log
|
||||||
ADD bitcoin.log.run /etc/service/bitcoin/log/run
|
ADD bitcoind.log.run /etc/service/bitcoind/log/run
|
||||||
|
|
||||||
RUN chmod +x /etc/service/bitcoin/log/run \
|
RUN chmod +x /etc/service/bitcoind/log/run \
|
||||||
/etc/service/bitcoin/run
|
/etc/service/bitcoind/run
|
||||||
|
4
Makefile
4
Makefile
@ -1,10 +1,10 @@
|
|||||||
default: build
|
default: build
|
||||||
|
|
||||||
build: kill
|
build: kill
|
||||||
docker build -t sneak/bitcoind:0.12.0 .
|
docker build -t sneak/bitcoind:master .
|
||||||
|
|
||||||
run: kill
|
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
|
docker logs -f sneak-bitcoind
|
||||||
|
|
||||||
kill:
|
kill:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export HOME="/var/lib/bitcoin"
|
export HOME="/var/lib/bitcoind"
|
||||||
|
|
||||||
# gen random pw for rpc server
|
# gen random pw for rpc server
|
||||||
RANDOMPW=$(dd if=/dev/urandom bs=10 count=1 status=none | shasum | cut -b 1-20)
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chown -R bitcoin:bitcoin $HOME
|
chown -R bitcoind:bitcoind $HOME
|
||||||
|
|
||||||
exec chpst -ubitcoin \
|
exec chpst -ubitcoind \
|
||||||
bitcoind $ARGS \
|
bitcoind $ARGS \
|
||||||
$BITCOIND_EXTRA_OPTS \
|
$BITCOIND_EXTRA_OPTS \
|
||||||
2>&1
|
2>&1
|
Loading…
Reference in New Issue
Block a user