init commit
Some checks failed
Build and Push to Registry / build-and-push (push) Failing after 6s

This commit is contained in:
Sosthene 2025-07-08 16:09:03 +02:00
commit 5b530f0877
2 changed files with 104 additions and 0 deletions

43
.github/workflows/cicd.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Build and Push to Registry
on:
push:
branches: [ master ]
env:
REGISTRY: git.4nkweb.com
IMAGE_NAME: 4nk/bitcoin
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up SSH agent
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.USER }}
password: ${{ secrets.TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
ssh: default
build-args: |
ENV_VARS=${{ secrets.ENV_VARS }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }}

61
Dockerfile Normal file
View File

@ -0,0 +1,61 @@
FROM alpine:3.15 as build
ARG BITCOIN_TAG=24.0.1
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk update && apk --no-cache add autoconf \
automake \
boost-dev \
build-base \
chrpath \
file \
gnupg \
libevent-dev \
libressl \
libtool \
linux-headers \
sqlite-dev \
git
RUN git clone https://github.com/bitcoin/bitcoin.git -b v$BITCOIN_TAG /src/bitcoin
WORKDIR /src/bitcoin
RUN ./autogen.sh
RUN ./configure --with-gui=no \
--with-daemon \
--without-miniupnpc \
--without-bdb \
--disable-zmq \
--disable-man \
--enable-util-cli \
--disable-static \
--disable-bench \
--disable-fuzz-binary \
--with-sqlite=yes
RUN make -j$(nproc)
RUN make check
RUN make install
RUN strip /usr/local/bin/bitcoin-cli
RUN strip /usr/local/bin/bitcoind
RUN strip /usr/local/bin/bitcoin-util
RUN strip /usr/local/lib/libbitcoinconsensus.so.0.0.0
# Build stage for compiled artifacts
FROM alpine:3.15
RUN addgroup -S -g 1000 bitcoin
RUN adduser -G bitcoin -S -u 1000 bitcoin
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add \
boost \
libevent \
su-exec
COPY --from=build /usr/local/bin/bitcoind /usr/local/bin/bitcoin-cli /usr/local/bin/bitcoin-util /usr/local/bin/
COPY --from=build /usr/local/lib/* /usr/local/lib/
COPY --from=build /usr/local/include/* /usr/local/include/
COPY --from=build /src/bitcoin/test/functional/test_framework/ /bitcoin/test/functional/test_framework
USER bitcoin