1
0
Fork 0
mirror of https://github.com/romanz/electrs.git synced 2025-02-22 22:36:37 +01:00
electrs/Dockerfile

45 lines
1.5 KiB
Text
Raw Normal View History

2021-03-26 11:05:58 +03:00
### Electrum Rust Server ###
2021-04-16 09:46:35 +03:00
FROM rust:1.41.1-slim as electrs-build
2021-03-26 11:05:58 +03:00
RUN apt-get update
RUN apt-get install -qq -y clang cmake
2021-08-21 19:11:45 +03:00
RUN rustup component add rustfmt clippy
2021-03-26 11:05:58 +03:00
# Build, test and install electrs
WORKDIR /build/electrs
COPY . .
RUN cargo fmt -- --check
2021-08-21 19:11:45 +03:00
RUN cargo clippy
2021-03-26 11:05:58 +03:00
RUN cargo build --locked --release --all
RUN cargo test --locked --release --all
RUN cargo install --locked --path .
FROM debian:buster-slim as updated
RUN apt-get update -qqy
### Bitcoin Core ###
FROM updated as bitcoin-build
# Download
RUN apt-get install -qqy wget
WORKDIR /build/bitcoin
2021-08-15 21:09:52 +03:00
ARG BITCOIND_VERSION=0.21.1
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 .
2021-03-26 11:05:58 +03:00
FROM updated as result
# Copy the binaries
COPY --from=electrs-build /usr/local/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
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 /