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

49 lines
1.7 KiB
Docker
Raw Normal View History

2020-12-03 17:28:33 +01:00
### Electrum Rust Server ###
FROM rust:1.41.1-slim as electrs-build
RUN apt-get update
RUN apt-get install -qq -y clang cmake
RUN rustup component add rustfmt
# Build, test and install electrs
WORKDIR /build/electrs
COPY . .
RUN cargo fmt -- --check
RUN cargo build --locked --release --all
RUN cargo test --locked --release --all
2020-12-07 09:56:37 +01:00
RUN cargo install --locked --path electrs_rpc
2020-12-03 17:28:33 +01:00
2020-12-02 09:11:17 +01:00
FROM debian:buster-slim as updated
2020-11-27 20:40:51 +01:00
RUN apt-get update
2020-12-02 09:11:17 +01:00
# Install Bitcoin Core runtime dependencies
RUN apt-get install -qqy libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev
2018-08-19 18:26:57 +02:00
2020-12-02 09:11:17 +01:00
### Bitcoin Core ###
FROM updated as bitcoin-build
2020-11-27 20:40:51 +01:00
# Buildtime dependencies
RUN apt-get install -qqy build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
# Clone source
RUN apt-get install -qqy git
WORKDIR /build/bitcoin
RUN git clone --branch locations https://github.com/romanz/bitcoin.git .
2020-12-02 09:11:17 +01:00
# Build bitcoin
RUN ./autogen.sh
RUN ./configure --disable-tests --disable-wallet --disable-bench --without-gui --without-miniupnpc
RUN make -j"$(($(nproc)+1))"
2020-12-02 09:11:17 +01:00
FROM updated as result
2020-12-07 15:17:56 +01:00
# Copy the binaries
COPY --from=electrs-build /usr/local/cargo/bin/electrs_rpc /usr/bin/electrs
COPY --from=bitcoin-build /build/bitcoin/src/bitcoind /build/bitcoin/src/bitcoin-cli /usr/bin/
RUN bitcoind -version && bitcoin-cli -version
2020-12-02 09:11:17 +01:00
### Electrum ###
2020-12-28 20:36:47 +01:00
# 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 netcat
RUN git clone --recurse-submodules https://github.com/spesmilo/electrum/ && cd electrum/ && git log -1
RUN python3 -m pip install -e electrum/
2020-12-07 15:17:56 +01:00
2020-11-27 20:40:51 +01:00
RUN electrum version --offline
2020-12-02 09:11:17 +01:00
WORKDIR /