Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker CI
on:
push:
tags:
- 'libre-relay-v29.0*'

jobs:
build:
name: Build and push to GitHub Container Registry
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Set VERSION
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Setup Docker buildx
run: docker buildx create --use

- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=${{ env.VERSION }} \
--tag ghcr.io/${{ github.repository }}:${{ env.VERSION }} \
--push .

- name: Rebuild for latest tag
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=${{ env.VERSION }} \
--tag ghcr.io/${{ github.repository }}:latest \
--push .
60 changes: 60 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Build stage
FROM debian:bookworm-slim AS builder

# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libboost-all-dev \
libevent-dev \
libtool \
pkg-config \
libzmq3-dev \
libsqlite3-dev \
# python3 - only needed if running test suite
# optional for UPnP support:
# libminiupnpc-dev \
# optional for NAT-PMP support:
# libnatpmp-dev \
&& rm -rf /var/lib/apt/lists/*

# Copy local bitcoin source
WORKDIR /build
COPY . .

# Build Bitcoin Core
RUN cmake -B build \
-DCMAKE_INSTALL_PREFIX=/build \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/build/bin \
-DINSTALL_MAN=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_CCACHE=OFF \
-DBUILD_TESTS=OFF \
-DREDUCE_EXPORTS=ON \
-DBUILD_UTIL=ON \
-DBUILD_WALLET_TOOL=ON \
-DWITH_ZMQ=ON
RUN cmake --build build

# Final stage
FROM debian:bookworm-slim

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
libevent-2.1-7 \
libevent-extra-2.1-7 \
libevent-pthreads-2.1-7 \
libzmq5 \
libsqlite3-0 \
libdb5.3++ \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /build/bin/bitcoind /bin
COPY --from=builder /build/bin/bitcoin-cli /bin

ENV HOME=/data
VOLUME /data/.bitcoin

EXPOSE 8332 8333 18332 18333 18443 18444

ENTRYPOINT ["bitcoind"]
Loading