Skip to content
Merged
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
47 changes: 47 additions & 0 deletions docker/electrs-blockstream/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ---- builder ----
ARG RUST_VERSION=1.90.0
FROM rust:${RUST_VERSION}-trixie AS builder

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential ca-certificates clang cmake curl g++ git libclang-dev make pkg-config \
&& apt-get install -y --no-install-recommends \
libbz2-dev liblz4-dev libsnappy-dev libzstd-dev zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /src
ARG REPO=https://github.com/blockstream/electrs.git
#ARG REF=new-index
# pin latest commit of branch new-index
ARG REF=f1823d82b03dbd1dfef53f7b3611128dd2f4c1d2

RUN git clone --filter=blob:none "${REPO}" . \
&& git fetch origin "${REF}" \
&& git checkout "${REF}"

# Build options: FEATURES="electrum-discovery,liquid"
# electrum-discovery -> discovery support
# liquid -> Elements/Liquid support
ARG FEATURES=electrum-discovery
RUN cargo build --locked --release --bin electrs --features "${FEATURES}"

# ---- runtime ----
FROM debian:trixie-slim
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'trixie-slim' without a specific version tag can lead to unpredictable builds when Debian releases change. Consider pinning to a specific Debian version (e.g., 'debian:12-slim' for bookworm) to ensure reproducible builds.

Suggested change
FROM debian:trixie-slim
FROM debian:12-slim

Copilot uses AI. Check for mistakes.

RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libstdc++6 curl \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -r -d /var/lib/electrs -s /usr/sbin/nologin electrs \
&& mkdir -p /data && chown -R electrs:electrs /data

COPY --from=builder /src/target/release/electrs /usr/local/bin/electrs

USER electrs
VOLUME ["/data"]

# Electrum RPC and HTTP API
EXPOSE 50001 3000

ENTRYPOINT ["/usr/local/bin/electrs"]
CMD ["--db-dir","/data","--electrum-rpc-addr","0.0.0.0:50001","--http-addr","0.0.0.0:3000"]
10 changes: 10 additions & 0 deletions docker/electrs-blockstream/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Electrs backend API optimized for public usage by Blockstream for the Esplora block explorer based on the re-implementation of romanz/electrs

- Blockstream/electrs: https://github.com/blockstream/electrs
- romanz/electrs https://github.com/romanz/electrs
- Blockstream/esplora https://github.com/Blockstream/esplora


Alternative image sources:
- https://github.com/getumbrel/docker-electrs (using romanz/electrs)
- https://github.com/mempool/electrs (based on romanz/electrs and Blockstream/electrs)
1 change: 1 addition & 0 deletions docker/electrs-blockstream/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0