2021-07-07 14:02:38 +02:00
|
|
|
# Important: This file is provided for demonstration purposes and may NOT be suitable for production use.
|
|
|
|
# The maintainers of electrs are not deeply familiar with Docker, so you should DYOR.
|
|
|
|
# If you are not familiar with Docker either it's probably be safer to NOT use it.
|
|
|
|
|
|
|
|
FROM debian:bullseye-slim as base
|
|
|
|
RUN apt-get update -qqy
|
2022-09-12 21:01:27 +02:00
|
|
|
RUN apt-get install -qqy librocksdb-dev wget
|
2021-07-07 14:02:38 +02:00
|
|
|
|
|
|
|
### Electrum Rust Server ###
|
|
|
|
FROM base as electrs-build
|
|
|
|
RUN apt-get install -qqy cargo clang cmake build-essential
|
|
|
|
|
|
|
|
# Install electrs
|
|
|
|
WORKDIR /build/electrs
|
|
|
|
COPY . .
|
|
|
|
ENV ROCKSDB_INCLUDE_DIR=/usr/include
|
|
|
|
ENV ROCKSDB_LIB_DIR=/usr/lib
|
|
|
|
RUN cargo install --locked --path .
|
|
|
|
|
|
|
|
### Bitcoin Core ###
|
|
|
|
FROM base as bitcoin-build
|
|
|
|
# Download
|
|
|
|
WORKDIR /build/bitcoin
|
2023-05-26 19:09:18 +02:00
|
|
|
ARG BITCOIND_VERSION=25.0
|
2021-07-07 14:02:38 +02:00
|
|
|
RUN wget -q https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz
|
|
|
|
RUN tar xvf bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz
|
|
|
|
RUN mv -v bitcoin-$BITCOIND_VERSION/bin/bitcoind .
|
|
|
|
RUN mv -v bitcoin-$BITCOIND_VERSION/bin/bitcoin-cli .
|
|
|
|
|
|
|
|
FROM base as result
|
|
|
|
# Copy the binaries
|
|
|
|
COPY --from=electrs-build /root/.cargo/bin/electrs /usr/bin/electrs
|
|
|
|
COPY --from=bitcoin-build /build/bitcoin/bitcoind /build/bitcoin/bitcoin-cli /usr/bin/
|
|
|
|
RUN bitcoind -version && bitcoin-cli -version
|
|
|
|
|
|
|
|
### Electrum ###
|
|
|
|
# Clone latest Electrum wallet and a few test tools
|
|
|
|
WORKDIR /build/
|
|
|
|
RUN apt-get install -qqy git libsecp256k1-0 python3-cryptography python3-setuptools python3-pip jq curl
|
|
|
|
RUN git clone --recurse-submodules https://github.com/spesmilo/electrum/ && cd electrum/ && git log -1
|
|
|
|
RUN python3 -m pip install -e electrum/
|
|
|
|
|
|
|
|
RUN electrum version --offline
|
|
|
|
WORKDIR /
|