docker-bitcoind/Dockerfile

81 lines
1.9 KiB
Docker
Raw Normal View History

2016-08-18 09:45:34 +00:00
FROM phusion/baseimage:0.9.19
2016-04-11 03:38:48 +00:00
2016-04-11 16:01:09 +00:00
ENV BITCOIND_REV master
2016-04-11 03:56:50 +00:00
2016-08-18 09:45:34 +00:00
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
2016-08-18 10:51:04 +00:00
ARG BITCOIN_REPO=https://github.com/bitcoin/bitcoin.git
2016-08-18 09:45:34 +00:00
2016-08-18 09:50:03 +00:00
RUN sed -i \
-e s#http://archive.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \
-e s#http://security.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \
2016-08-18 09:45:34 +00:00
/etc/apt/sources.list ; \
cat /etc/apt/sources.list
2016-04-11 03:38:48 +00:00
RUN \
apt-get update && \
2016-04-11 03:38:48 +00:00
apt-get install -y \
automake \
autotools-dev \
bsdmainutils \
build-essential \
git \
libboost-chrono-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libminiupnpc-dev \
libssl-dev \
libtool \
libzmq3-dev \
libzmq5 \
pkg-config \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2016-04-11 03:38:48 +00:00
2016-08-18 10:51:04 +00:00
RUN \
git clone $BITCOIN_REPO /usr/local/src/bitcoin && \
cd /usr/local/src/bitcoin && \
2016-04-11 03:53:24 +00:00
git checkout $BITCOIND_REV && \
2016-04-11 03:38:48 +00:00
./autogen.sh && \
./configure --disable-wallet --enable-hardening && \
2016-04-11 15:51:16 +00:00
make -j2 && \
2016-04-11 03:53:24 +00:00
make install && \
cd / && \
rm -rf /usr/local/src/bitcoin
2016-04-11 03:38:48 +00:00
RUN \
apt-get remove -y \
automake \
autotools-dev \
bsdmainutils \
build-essential \
git \
libtool \
pkg-config \
&& \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2016-04-11 03:38:48 +00:00
2016-08-18 10:51:04 +00:00
ENV HOME /var/lib/bitcoind
RUN useradd -s /bin/bash -m -d /var/lib/bitcoind bitcoind
RUN chown bitcoind:bitcoind -R /var/lib/bitcoind
2016-04-11 03:38:48 +00:00
2016-08-18 10:51:04 +00:00
VOLUME ["/var/lib/bitcoind"]
2016-04-11 03:53:24 +00:00
2016-04-11 03:38:48 +00:00
EXPOSE 8332
2016-04-11 03:53:24 +00:00
2016-04-11 03:38:48 +00:00
EXPOSE 8333
2016-08-18 10:51:04 +00:00
RUN mkdir -p /etc/service/bitcoind
ADD bitcoind.run /etc/service/bitcoind/run
2016-04-11 03:53:24 +00:00
2016-08-18 10:51:04 +00:00
RUN mkdir -p /etc/service/bitcoind/log
ADD bitcoind.log.run /etc/service/bitcoind/log/run
2016-04-11 03:53:24 +00:00
2016-08-18 10:51:04 +00:00
RUN chmod +x /etc/service/bitcoind/log/run \
/etc/service/bitcoind/run