Skip to content
Open
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
230 changes: 0 additions & 230 deletions docker-bake.hcl

This file was deleted.

31 changes: 0 additions & 31 deletions docs/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,34 +72,3 @@ python3 -m build
# Upload to Pypi
python3 -m twine upload dist/*
```

## Building docker images

The Bitcoin Core docker images used by warnet are specified in the *docker-bake.hcl* file.
This uses the (experimental) `bake` build functionality of docker buildx.
We use [HCL language](https://github.com/hashicorp/hcl) in the declaration file itself.
See the `bake` [documentation](https://docs.docker.com/build/bake/) for more information on specifications, and how to e.g. override arguments.

In order to build (or "bake") a certain image, find the image's target (name) in the *docker-bake.hcl* file, and then run `docker buildx bake <target>`.

```bash
# build the dummy image that will crash on 5k invs
docker buildx bake bitcoin-5k-inv

# build the same image, but set platform to only linux/amd64
docker buildx bake bitcoin-5k-inv --set bitcoin-5k-inv.platform=linux/amd64
```

To load the single-platform build result to `docker images`, run:

```bash
docker buildx bake --load bitcoin-5k-inv
```

Push the build result to a registry by running:

```bash
docker buildx bake --push bitcoin-5k-inv
```

It will automatically push the build result to registry.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Setup deps stage
FROM alpine AS deps
FROM alpine:3.20 AS deps
ARG REPO
ARG COMMIT_SHA
ARG BUILD_ARGS
Expand Down Expand Up @@ -36,14 +36,20 @@ RUN set -ex \
&& git clone --depth 1 "https://github.com/${REPO}" \
&& cd bitcoin \
&& git fetch --depth 1 origin "$COMMIT_SHA" \
&& git checkout "$COMMIT_SHA" \
&& git checkout FETCH_HEAD \
&& git apply /tmp/isroutable.patch \
&& git apply /tmp/addrman.patch \
&& sed -i s:sys/fcntl.h:fcntl.h: src/compat/compat.h \
&& ./autogen.sh \
&& DB_PREFIX="$(ls -d /opt/db-* 2>/dev/null | head -n1 || true)" \
&& if [ -n "$DB_PREFIX" ] && [ -d "$DB_PREFIX/lib" ]; then \
export LDFLAGS="-L${DB_PREFIX}/lib"; \
export CPPFLAGS="-g0 -I${DB_PREFIX}/include --param ggc-min-expand=1 --param ggc-min-heapsize=32768"; \
else \
export LDFLAGS=""; \
export CPPFLAGS="-g0 --param ggc-min-expand=1 --param ggc-min-heapsize=32768"; \
fi \
&& ./configure \
LDFLAGS=-L`ls -d /opt/db*`/lib/ \
CPPFLAGS="-g0 -I`ls -d /opt/db*`/include/ --param ggc-min-expand=1 --param ggc-min-heapsize=32768" \
--prefix=${BITCOIN_PREFIX} \
${BUILD_ARGS} \
&& make -j$(nproc) \
Expand All @@ -56,8 +62,7 @@ RUN set -ex \
&& rm ${BITCOIN_PREFIX}/bin/bitcoin-wallet \
&& rm ${BITCOIN_PREFIX}/bin/bitcoin-util

# Final clean stage
FROM alpine
FROM alpine:3.20
ARG UID=100
ARG GID=101
ENV BITCOIN_DATA=/root/.bitcoin
Expand All @@ -84,4 +89,3 @@ EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332

ENTRYPOINT ["/entrypoint.sh"]
CMD ["bitcoind"]

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN set -ex \
&& git clone --depth 1 "https://github.com/${REPO}" \
&& cd bitcoin \
&& git fetch --depth 1 origin "$COMMIT_SHA" \
&& git checkout "$COMMIT_SHA" \
&& git checkout FETCH_HEAD \
&& git apply /tmp/isroutable.patch \
&& git apply /tmp/addrman.patch \
&& sed -i s:sys/fcntl.h:fcntl.h: src/compat/compat.h \
Expand All @@ -51,7 +51,6 @@ RUN set -ex \
&& rm -f ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a \
&& rm -f ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0

# Final clean stage
FROM alpine:3.20
ARG UID=100
ARG GID=101
Expand Down
1 change: 0 additions & 1 deletion resources/images/bitcoin/insecure/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,3 @@ EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332

ENTRYPOINT ["/entrypoint.sh"]
CMD ["bitcoind"]

Loading
Loading