Skip to content

Commit 2abdbd3

Browse files
committed
Build for Linux with Dockerfile
1 parent 5cef24d commit 2abdbd3

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

contrib/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DEFAULT_GOAL := copy
2+
BPRO_VERSION?=0.1.0
3+
4+
build:
5+
docker build -f bitcoin-pro-builder.dockerfile --build-arg=BPRO_VERSION=$(BPRO_VERSION) . -t bitcoin-pro:${BPRO_VERSION}
6+
7+
copy: build
8+
docker create --name bitcoin-pro bitcoin-pro:$(BPRO_VERSION)
9+
docker cp bitcoin-pro:/bitcoin-pro ./bitcoin-pro_$(BPRO_VERSION)
10+
docker rm bitcoin-pro

contrib/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Build with Docker
2+
3+
## Requirements
4+
5+
You need to install [Docker](https://docs.docker.com/desktop/).
6+
7+
## TL;DR
8+
9+
```
10+
make
11+
./bitcoin-pro
12+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM ubuntu:focal as builder
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
ARG BPRO_VERSION
5+
6+
RUN apt update && apt upgrade -yqq && apt install -yqq \
7+
curl \
8+
cargo \
9+
libssl-dev \
10+
libzmq3-dev \
11+
pkg-config \
12+
g++ \
13+
cmake \
14+
libgtk-3-dev \
15+
libsqlite3-dev
16+
17+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
18+
19+
RUN . $HOME/.cargo/env && rustup default nightly
20+
21+
RUN . $HOME/.cargo/env && cargo install bitcoin-pro
22+
23+
FROM alpine:latest
24+
25+
WORKDIR /
26+
COPY --from=builder /root/.cargo/bin/bitcoin-pro .
27+
28+
# TODO: enable running the bin directly inside a container
29+
# ENTRYPOINT [ "bitcoin-pro" ]

0 commit comments

Comments
 (0)