-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 469401d
Showing
4 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
# Publish `master` as Docker `latest` image. | ||
branches: | ||
- master | ||
|
||
env: | ||
# TODO: Change variable to your image's name. | ||
IMAGE_NAME: bitcoin-cat | ||
|
||
jobs: | ||
# Push image to GitHub Packages. | ||
# See also https://docs.docker.com/docker-hub/builds/ | ||
push: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
install: true | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build image | ||
run: >- | ||
docker buildx build --push | ||
--tag ghcr.io/vulpemventures/$IMAGE_NAME:latest | ||
--platform linux/arm64,linux/amd64 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Define the base image for the build stage | ||
FROM debian:stable-slim as builder | ||
|
||
# Set ARGs for build-time variables | ||
ARG VERSION=dont-success-cat | ||
ARG REPO_URL=https://github.com/rot13maxi/bitcoin.git | ||
|
||
# Install build dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
automake \ | ||
pkg-config \ | ||
libtool \ | ||
autotools-dev \ | ||
bsdmainutils \ | ||
python3 \ | ||
git \ | ||
libboost-system-dev \ | ||
libboost-filesystem-dev \ | ||
libboost-thread-dev \ | ||
libevent-dev \ | ||
libsqlite3-dev \ | ||
libdb-dev \ | ||
libdb++-dev \ | ||
libzmq3-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone the repository at the specified version | ||
RUN git clone --branch $VERSION $REPO_URL /bitcoin-source | ||
WORKDIR /bitcoin-source | ||
|
||
# Build the dependencies and configure settings | ||
RUN ./autogen.sh && \ | ||
./configure \ | ||
CXXFLAGS="-O2" \ | ||
--disable-man \ | ||
--disable-shared \ | ||
--disable-ccache \ | ||
--disable-tests \ | ||
--enable-static \ | ||
--enable-reduce-exports \ | ||
--without-gui \ | ||
--without-libs \ | ||
--with-utils \ | ||
--with-zmq \ | ||
--with-sqlite=yes \ | ||
--with-incompatible-bdb && \ | ||
make -j$(nproc) | ||
|
||
# Install the binaries to a separate directory | ||
RUN make install DESTDIR=/bitcoin-dist | ||
|
||
# Start the final stage for a smaller, cleaner image | ||
FROM debian:stable-slim | ||
|
||
# Install runtime dependencies, cleanup and create linux user bitcoin | ||
RUN apt-get update && apt-get install -y \ | ||
libboost-system-dev \ | ||
libboost-filesystem-dev \ | ||
libboost-thread-dev \ | ||
libevent-dev \ | ||
libzmq3-dev \ | ||
libsqlite3-dev \ | ||
libdb-dev \ | ||
libdb++-dev && \ | ||
rm -rf /var/lib/apt/lists/* \ | ||
&& useradd -ms /bin/bash bitcoin | ||
|
||
USER bitcoin | ||
WORKDIR /home/bitcoin | ||
|
||
# Copy the built binaries from the builder stage | ||
COPY --from=builder /bitcoin-dist/usr/local /usr/local | ||
|
||
# Prepare the data directory | ||
RUN mkdir -p "$HOME/.bitcoin/" | ||
|
||
# Set the entrypoint to the bitcoind daemon | ||
ENTRYPOINT ["bitcoind"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Vulpem Ventures | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Docker bitcoin | ||
|
||
Dockerfile of the public image [ghcr.io/vulpemventures/bitcoin-cat:latest](https://github.com/orgs/vulpemventures/packages/container/package/bitcoin-cat) | ||
|
||
|
||
Pull the image: | ||
|
||
```bash | ||
$ docker pull ghcr.io/vulpemventures/bitcoin-cat:latest | ||
``` | ||
|
||
Run the image: | ||
|
||
```bash | ||
$ docker run -v path/to/bitcoin.conf:/home/bitcoin/.bitcoin -d ghcr.io/vulpemventures/bitcoin-cat:latest | ||
``` | ||
|
||
|
||
## Release | ||
|
||
To tag a new image with a new version, change the branch in Dockerfile and push it to the repository. | ||
|