Skip to content

Commit

Permalink
add docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
yancyribbens committed Feb 12, 2020
1 parent 22066f5 commit 1254b86
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM ubuntu:18.04
maintainer satoshi

RUN apt-get update -qq && apt-get install -y \
git \
wget \
build-essential \
libtool \
autotools-dev \
automake \
pkg-config \
libssl-dev \
libevent-dev \
bsdmainutils \
python3 \
libboost-all-dev \
vim \
python3-pip

# Checkout bitcoin source
RUN mkdir /optech
WORKDIR /optech
RUN git clone https://github.com/yancyribbens/taproot-workshop.git
RUN git clone https://github.com/bitcoinops/bitcoin && cd ./bitcoin && git checkout Taproot_V0.1.4

# Install Berkley Database
RUN wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
RUN tar -xvf db-4.8.30.NC.tar.gz
WORKDIR /optech/db-4.8.30.NC/build_unix
RUN mkdir -p build
RUN BDB_PREFIX=$(pwd)/build
RUN ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX
RUN make install

# install bitcoin
WORKDIR /optech/bitcoin
RUN ./autogen.sh
RUN ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --without-gui
RUN make
RUN make install

# configure bitcoin network
ARG NETWORK=regtest
ARG RPC_USER=foo
ARG RPC_PASSWORD=bar
RUN mkdir -p ~/.bitcoin
RUN rpcuser="rpcuser=${RPC_USER}" && \
rpcpassword="rpcpassword=${RPC_PASSWORD}" && \
network="${NETWORK}=1" && \
rpcport="rpcport=8332" && \
rpcallowip="rpcallowip=127.0.0.1" && \
rpcconnect="rpcconnect=127.0.0.1" && \
echo "$rpcuser\n$rpcpassword\n$network\n$rpcport\n$rpcallowip\n$rpcconnect" > /root/.bitcoin/bitcoin.conf

WORKDIR /optech/taproot-workshop
RUN sed -i.bak s/^SOURCE_DIRECTORY=/SOURCE_DIRECTORY=\/optech\/bitcoin/g config.ini
RUN pip3 install -r requirements.txt

ENTRYPOINT ["jupyter", "notebook", "--allow-root", "--ip=0.0.0.0", "--no-browser"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,17 @@ virtual environment with:
```
$ deactivate
```

### Docker Setup Local

if you wish to automate the build using docker instead of the previous steps locally

#### Build
```
$ docker build . -t optech
```

### Run
```
$ docker run -it -p 127.0.0.1:8888:8888 optech
```

0 comments on commit 1254b86

Please sign in to comment.