This commit is contained in:
Jeffrey Paul 2016-04-11 05:53:24 +02:00
parent 63477b2b5f
commit 7c75d2261f

View File

@ -1,47 +1,49 @@
FROM phusion/baseimage:0.9.18 FROM phusion/baseimage:0.9.18
ENV BITCOIND_VERSION 0.12.0 ENV BITCOIND_REV 188ca9c305d3dd0fb462b9d6a44048b1d99a05f3 #v0.12.0
ADD ./sources.list /etc/apt/sources.list ADD ./sources.list /etc/apt/sources.list
ADD \
https://github.com/bitcoin/bitcoin/archive/v$BITCOIND_VERSION.tar.gz \
/usr/local/src/bitcoin.tgz
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
build-essential libtool autotools-dev automake pkg-config libssl-dev \ build-essential libtool autotools-dev automake pkg-config libssl-dev \
libevent-dev bsdmainutils libboost-all-dev libzmq3 libzmq3-dev \ libevent-dev bsdmainutils libboost-all-dev libzmq3 libzmq3-dev \
libminiupnpc-dev && \ libminiupnpc-dev git && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN cd /usr/local/src && \ RUN git clone https://github.com/bitcoin/bitcoin.git /usr/local/src/bitcoin
tar zxvf bitcoin.tgz && \
rm bitcoin.tgz
RUN cd /usr/local/src/bitcoin* && \ RUN cd /usr/local/src/bitcoin && \
RUN cd /usr/local/src/bitcoin && \
git checkout $BITCOIND_REV && \
./autogen.sh && \ ./autogen.sh && \
./configure --disable-wallet --enable-hardening && \ ./configure --disable-wallet --enable-hardening && \
make -j10 && \ make -j10 && \
make install make install && \
cd / && \
rm -rf /usr/local/src/bitcoin
RUN apt-get remove -y \ RUN apt-get remove -y \
build-essential libtool autotools-dev automake pkg-config libssl-dev \ build-essential libtool autotools-dev automake pkg-config libssl-dev \
libevent-dev bsdmainutils libboost-all-dev libzmq3-dev \ libevent-dev bsdmainutils libboost-all-dev libzmq3-dev \
libminiupnpc-dev && \ libminiupnpc-dev git && \
apt-get autoremove -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* apt-get autoremove -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV HOME /var/lib/bitcoin ENV HOME /var/lib/bitcoin
RUN useradd -s /bin/bash -m -d /var/lib/bitcoin bitcoin RUN useradd -s /bin/bash -m -d /var/lib/bitcoin bitcoin
RUN chown bitcoin:bitcoin -R /var/lib/bitcoin RUN chown bitcoin:bitcoin -R /var/lib/bitcoin
VOLUME ["/var/lib/bitcoin/.bitcoin"] VOLUME ["/var/lib/bitcoin"]
EXPOSE 8332 EXPOSE 8332
EXPOSE 8333 EXPOSE 8333
RUN mkdir -p /etc/service/bitcoin RUN mkdir -p /etc/service/bitcoin
ADD bitcoin.run /etc/service/bitcoin/run ADD bitcoin.run /etc/service/bitcoin/run
RUN mkdir -p /etc/service/bitcoin/log RUN mkdir -p /etc/service/bitcoin/log
ADD bitcoin.log.run /etc/service/bitcoin/log/run ADD bitcoin.log.run /etc/service/bitcoin/log/run
RUN chmod +x /etc/service/bitcoin/log/run \ RUN chmod +x /etc/service/bitcoin/log/run \
/etc/service/bitcoin/run /etc/service/bitcoin/run