2021-07-07 15:02:38 +03: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.
|
|
|
|
|
|
2024-12-18 09:07:46 +02:00
|
|
|
FROM debian:trixie-slim AS base
|
2021-07-07 15:02:38 +03:00
|
|
|
RUN apt-get update -qqy
|
2025-12-28 10:50:53 +01:00
|
|
|
RUN apt-get install -qqy librocksdb-dev libsqlite3-dev libevent-dev libboost-dev wget
|
2021-07-07 15:02:38 +03:00
|
|
|
|
|
|
|
|
### Electrum Rust Server ###
|
2025-07-19 14:12:00 +03:00
|
|
|
FROM base AS electrs-build
|
2024-12-18 09:07:46 +02:00
|
|
|
RUN apt-get install -qqy cargo build-essential libclang-dev
|
2021-07-07 15:02:38 +03:00
|
|
|
|
|
|
|
|
# Install electrs
|
|
|
|
|
WORKDIR /build/electrs
|
|
|
|
|
COPY . .
|
|
|
|
|
ENV ROCKSDB_INCLUDE_DIR=/usr/include
|
|
|
|
|
ENV ROCKSDB_LIB_DIR=/usr/lib
|
|
|
|
|
RUN cargo install --locked --path .
|
|
|
|
|
|
2025-12-28 10:50:53 +01:00
|
|
|
### Bitcoin Core (custom build for /blockpart/ REST endpoint) ###
|
2025-07-19 14:12:00 +03:00
|
|
|
FROM base AS bitcoin-build
|
2021-07-07 15:02:38 +03:00
|
|
|
# Download
|
|
|
|
|
WORKDIR /build/bitcoin
|
2025-12-28 10:50:53 +01:00
|
|
|
|
2026-07-18 12:20:42 +02:00
|
|
|
RUN wget -q https://bitcoincore.org/bin/bitcoin-core-31.1/bitcoin-31.1-x86_64-linux-gnu.tar.gz
|
|
|
|
|
RUN tar xvf bitcoin-31.1-x86_64-linux-gnu.tar.gz
|
|
|
|
|
RUN mv -v bitcoin-31.1/bin/bitcoind .
|
|
|
|
|
RUN mv -v bitcoin-31.1/bin/bitcoin-cli .
|
2021-07-07 15:02:38 +03:00
|
|
|
|
2025-07-19 14:12:00 +03:00
|
|
|
FROM base AS result
|
2021-07-07 15:02:38 +03:00
|
|
|
# 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/
|
2024-12-18 09:07:46 +02:00
|
|
|
RUN apt-get install -qqy git libsecp256k1-2 python3-cryptography python3-setuptools python3-venv python3-pip jq curl
|
2021-07-07 15:02:38 +03:00
|
|
|
RUN git clone --recurse-submodules https://github.com/spesmilo/electrum/ && cd electrum/ && git log -1
|
2022-11-06 19:23:39 +02:00
|
|
|
RUN python3 -m venv --system-site-packages venv && \
|
2024-10-12 12:36:46 +03:00
|
|
|
ELECTRUM_ECC_DONT_COMPILE=1 venv/bin/pip install -e electrum/ && \
|
2022-11-06 19:23:39 +02:00
|
|
|
ln /build/venv/bin/electrum /usr/bin/electrum
|
2021-07-07 15:02:38 +03:00
|
|
|
|
|
|
|
|
RUN electrum version --offline
|
|
|
|
|
WORKDIR /
|