Skip to content

Commit e6c92a7

Browse files
committed
Add GitHub CI
1 parent 5c04e99 commit e6c92a7

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Docker CI
2+
on:
3+
push:
4+
tags:
5+
- 'libre-relay-v29.0*'
6+
7+
jobs:
8+
build:
9+
name: Build and push to GitHub Container Registry
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- name: Set VERSION
16+
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
17+
18+
- uses: actions/checkout@v4
19+
20+
- name: Login to GitHub Container Registry
21+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
22+
23+
- name: Setup Docker buildx
24+
run: docker buildx create --use
25+
26+
- name: Run Docker buildx
27+
run: |
28+
docker buildx build \
29+
--platform linux/amd64,linux/arm64 \
30+
--build-arg VERSION=${{ env.VERSION }} \
31+
--tag ghcr.io/${{ github.repository }}:${{ env.VERSION }} \
32+
--push .
33+
34+
- name: Rebuild for latest tag
35+
run: |
36+
docker buildx build \
37+
--platform linux/amd64,linux/arm64 \
38+
--build-arg VERSION=${{ env.VERSION }} \
39+
--tag ghcr.io/${{ github.repository }}:latest \
40+
--push .

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Build stage
2+
FROM debian:bookworm-slim AS builder
3+
4+
# Install build dependencies
5+
RUN apt-get update && apt-get install -y \
6+
build-essential \
7+
cmake \
8+
libboost-all-dev \
9+
libevent-dev \
10+
libtool \
11+
pkg-config \
12+
libzmq3-dev \
13+
libsqlite3-dev \
14+
# python3 - only needed if running test suite
15+
# optional for UPnP support:
16+
# libminiupnpc-dev \
17+
# optional for NAT-PMP support:
18+
# libnatpmp-dev \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# Copy local bitcoin source
22+
WORKDIR /build
23+
COPY . .
24+
25+
# Build Bitcoin Core
26+
RUN cmake -B build \
27+
-DCMAKE_INSTALL_PREFIX=/build \
28+
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/build/bin \
29+
-DINSTALL_MAN=OFF \
30+
-DBUILD_SHARED_LIBS=OFF \
31+
-DWITH_CCACHE=OFF \
32+
-DBUILD_TESTS=OFF \
33+
-DREDUCE_EXPORTS=ON \
34+
-DBUILD_UTIL=ON \
35+
-DBUILD_WALLET_TOOL=ON \
36+
-DWITH_ZMQ=ON
37+
RUN cmake --build build
38+
39+
# Final stage
40+
FROM debian:bookworm-slim
41+
42+
# Install runtime dependencies
43+
RUN apt-get update && apt-get install -y \
44+
libevent-2.1-7 \
45+
libevent-extra-2.1-7 \
46+
libevent-pthreads-2.1-7 \
47+
libzmq5 \
48+
libsqlite3-0 \
49+
libdb5.3++ \
50+
&& rm -rf /var/lib/apt/lists/*
51+
52+
COPY --from=builder /build/bin/bitcoind /bin
53+
COPY --from=builder /build/bin/bitcoin-cli /bin
54+
55+
ENV HOME=/data
56+
VOLUME /data/.bitcoin
57+
58+
EXPOSE 8332 8333 18332 18333 18443 18444
59+
60+
ENTRYPOINT ["bitcoind"]

0 commit comments

Comments
 (0)