1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 01:43:29 +01:00
electrs/Dockerfile

45 lines
1.5 KiB
Docker
Raw Normal View History

2021-03-26 09:05:58 +01:00
### Electrum Rust Server ###
2021-04-16 08:46:35 +02:00
FROM rust:1.41.1-slim as electrs-build
2021-03-26 09:05:58 +01:00
RUN apt-get update
RUN apt-get install -qq -y clang cmake
2021-08-21 18:11:45 +02:00
RUN rustup component add rustfmt clippy
2021-03-26 09:05:58 +01:00
# Build, test and install electrs
WORKDIR /build/electrs
COPY . .
RUN cargo fmt -- --check
2021-08-21 18:11:45 +02:00
RUN cargo clippy
2021-03-26 09:05:58 +01: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
ARG BITCOIND_VERSION=22.0
2021-08-15 20:09:52 +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 .
2021-03-26 09:05:58 +01: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/
2021-08-27 20:09:48 +02:00
RUN apt-get install -qqy git libsecp256k1-0 python3-cryptography python3-setuptools python3-pip jq curl
2021-03-26 09:05:58 +01:00
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 /