Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker config #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/bitcoinops/taproot-workshop
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
```