Skip to content

Commit 1254b86

Browse files
committed
add docker config
1 parent 22066f5 commit 1254b86

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

Dockerfile

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ubuntu:18.04
2+
maintainer satoshi
3+
4+
RUN apt-get update -qq && apt-get install -y \
5+
git \
6+
wget \
7+
build-essential \
8+
libtool \
9+
autotools-dev \
10+
automake \
11+
pkg-config \
12+
libssl-dev \
13+
libevent-dev \
14+
bsdmainutils \
15+
python3 \
16+
libboost-all-dev \
17+
vim \
18+
python3-pip
19+
20+
# Checkout bitcoin source
21+
RUN mkdir /optech
22+
WORKDIR /optech
23+
RUN git clone https://github.com/yancyribbens/taproot-workshop.git
24+
RUN git clone https://github.com/bitcoinops/bitcoin && cd ./bitcoin && git checkout Taproot_V0.1.4
25+
26+
# Install Berkley Database
27+
RUN wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
28+
RUN tar -xvf db-4.8.30.NC.tar.gz
29+
WORKDIR /optech/db-4.8.30.NC/build_unix
30+
RUN mkdir -p build
31+
RUN BDB_PREFIX=$(pwd)/build
32+
RUN ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX
33+
RUN make install
34+
35+
# install bitcoin
36+
WORKDIR /optech/bitcoin
37+
RUN ./autogen.sh
38+
RUN ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --without-gui
39+
RUN make
40+
RUN make install
41+
42+
# configure bitcoin network
43+
ARG NETWORK=regtest
44+
ARG RPC_USER=foo
45+
ARG RPC_PASSWORD=bar
46+
RUN mkdir -p ~/.bitcoin
47+
RUN rpcuser="rpcuser=${RPC_USER}" && \
48+
rpcpassword="rpcpassword=${RPC_PASSWORD}" && \
49+
network="${NETWORK}=1" && \
50+
rpcport="rpcport=8332" && \
51+
rpcallowip="rpcallowip=127.0.0.1" && \
52+
rpcconnect="rpcconnect=127.0.0.1" && \
53+
echo "$rpcuser\n$rpcpassword\n$network\n$rpcport\n$rpcallowip\n$rpcconnect" > /root/.bitcoin/bitcoin.conf
54+
55+
WORKDIR /optech/taproot-workshop
56+
RUN sed -i.bak s/^SOURCE_DIRECTORY=/SOURCE_DIRECTORY=\/optech\/bitcoin/g config.ini
57+
RUN pip3 install -r requirements.txt
58+
59+
ENTRYPOINT ["jupyter", "notebook", "--allow-root", "--ip=0.0.0.0", "--no-browser"]

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,17 @@ virtual environment with:
222222
```
223223
$ deactivate
224224
```
225+
226+
### Docker Setup Local
227+
228+
if you wish to automate the build using docker instead of the previous steps locally
229+
230+
#### Build
231+
```
232+
$ docker build . -t optech
233+
```
234+
235+
### Run
236+
```
237+
$ docker run -it -p 127.0.0.1:8888:8888 optech
238+
```

0 commit comments

Comments
 (0)