From db1d717f1b7d36a9752df1604b467d20612156af Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 24 Nov 2026 19:17:04 -0700 Subject: [PATCH 1/4] Dockerfile: add a release mode installing the GPG-signed release tarball With --build-arg LIGHTNINGD_FROM=release the image installs the reproducibly built Ubuntu 22.04 tarball of ${VERSION} from the GitHub release instead of compiling, after tools/verify-release-tarball.sh has checked it against the SHA256SUMS manifest, the manifest's signatures and the keys in contrib/keys. The script reads gpg's status lines, since `gpg --verify` fails whenever a co-signer's key is unknown. The binaries are not stripped, so they stay byte-identical to the signed tarball. The default source mode is unchanged. Co-Authored-By: Claude Fable 5.1 --- Dockerfile | 65 ++++++++++++++++++++++++++++++++- tools/verify-release-tarball.sh | 51 ++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 2 deletions(-) create mode 100755 tools/verify-release-tarball.sh diff --git a/Dockerfile b/Dockerfile index b6285d8bc6a2..9fec08d7fcfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,12 @@ # syntax=docker/dockerfile:1.7-labs +# LIGHTNINGD_FROM=source compiles this checkout; =release installs the +# GPG-signed release tarball of ${VERSION} (see the cln-release stages). +ARG LIGHTNINGD_FROM=source + +# Its glibc must not be newer than the base image's (jammy 2.35 < bookworm 2.36). +ARG CLN_RELEASE_PLATFORM=Ubuntu-22.04 + FROM --platform=${BUILDPLATFORM} debian:bookworm-slim AS base-host SHELL ["/bin/bash", "-euo", "pipefail", "-c"] @@ -11,14 +18,21 @@ SHELL ["/bin/bash", "-euo", "pipefail", "-c"] FROM base-host AS downloader-linux-amd64 ARG target_arch=x86_64-linux-gnu +# Names used by the release tarballs and manifests. +ARG release_arch=amd64 +ARG release_sums_suffix= FROM base-host AS downloader-linux-arm64 ARG target_arch=aarch64-linux-gnu +ARG release_arch=arm64 +ARG release_sums_suffix=-arm64 FROM base-host AS downloader-linux-arm ARG target_arch=arm-linux-gnueabihf +ARG release_arch=armv7 +ARG release_sums_suffix=-armv7 FROM downloader-${TARGETOS}-${TARGETARCH} AS downloader @@ -43,6 +57,48 @@ RUN gpg --quiet --import gpg/* && \ RUN tar xzf ${BITCOIN_TARBALL} --strip-components=1 +# Release tarball and signed manifest, from the GitHub release. +FROM downloader-${TARGETOS}-${TARGETARCH} AS cln-release-download + +ARG VERSION +ARG CLN_RELEASE_URL=https://github.com/ElementsProject/lightning/releases/download/${VERSION} +ARG CLN_RELEASE_PLATFORM + +ADD ${CLN_RELEASE_URL}/clightning-${VERSION}-${CLN_RELEASE_PLATFORM}-${release_arch}.tar.xz /release/ +ADD ${CLN_RELEASE_URL}/SHA256SUMS-${VERSION}${release_sums_suffix} /release/ +ADD ${CLN_RELEASE_URL}/SHA256SUMS-${VERSION}${release_sums_suffix}.asc /release/ + +# Override with local copies: --build-context cln-release= +FROM scratch AS cln-release + +COPY --from=cln-release-download /release/ / + +# Verify against contrib/keys, then unpack as signed (not stripped) where +# the builder stage would install. +FROM downloader AS install-release + +ARG VERSION +ARG CLN_RELEASE_PLATFORM +ARG CLN_TARBALL=clightning-${VERSION}-${CLN_RELEASE_PLATFORM}-${release_arch}.tar.xz +ARG CLN_SUMS=SHA256SUMS-${VERSION}${release_sums_suffix} +# Good signatures the manifest must carry (published images: 2). +ARG CLN_RELEASE_MIN_SIGNATURES=1 + +RUN apt-get update && \ + apt-get install -qq -y --no-install-recommends \ + xz-utils + +WORKDIR /opt/lightning-release + +COPY --from=cln-release ${CLN_TARBALL} ${CLN_SUMS} ${CLN_SUMS}.asc ./ +COPY contrib/keys/*.txt keys/ +COPY tools/verify-release-tarball.sh ./ + +# Drop the tarball's leading ./usr. +RUN ./verify-release-tarball.sh keys ${CLN_SUMS} ${CLN_TARBALL} ${CLN_RELEASE_MIN_SIGNATURES} && \ + mkdir -p /tmp/lightning_install && \ + tar xJf ${CLN_TARBALL} -C /tmp/lightning_install --strip-components=2 + FROM base-host AS base-builder RUN apt-get update && \ @@ -161,6 +217,11 @@ RUN find /tmp/lightning_install -type f -executable -exec \ awk -F: '/ELF/ {print $1}' | \ xargs -r ${STRIP} --strip-unneeded +FROM builder AS install-source + +# Install tree the images copy, per LIGHTNINGD_FROM. +FROM install-${LIGHTNINGD_FROM} AS install + # VLS builder stage (only used by lightningd-vls-signer) FROM base-builder-${TARGETOS}-${TARGETARCH} AS vls-builder @@ -240,7 +301,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* COPY --from=downloader /opt/bitcoin/bin/bitcoin-cli /usr/bin/ -COPY --from=builder /tmp/lightning_install/ /usr/local/ +COPY --from=install /tmp/lightning_install/ /usr/local/ COPY tools/docker-entrypoint.sh /entrypoint.sh @@ -268,7 +329,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* COPY --from=downloader /opt/bitcoin/bin/bitcoin-cli /usr/bin/ -COPY --from=builder /tmp/lightning_install/ /usr/local/ +COPY --from=install /tmp/lightning_install/ /usr/local/ COPY --from=vls-builder /tmp/vls_install/remote_hsmd_socket /var/lib/vls/bin/ COPY tools/docker-entrypoint.sh /entrypoint.sh diff --git a/tools/verify-release-tarball.sh b/tools/verify-release-tarball.sh new file mode 100755 index 000000000000..bd8fab6dab00 --- /dev/null +++ b/tools/verify-release-tarball.sh @@ -0,0 +1,51 @@ +#! /bin/sh +# Usage: verify-release-tarball.sh [min-signatures] +# +# Succeeds when .asc has >= min-signatures (default 1) good +# signatures from the *.txt keys in and no bad one, and the +# tarball matches its line in . gpg's exit status is useless +# here: it fails whenever any co-signer's key is unknown, so we read its +# status lines instead. +set -e + +KEYS=${1:-} +SUMS=${2:-} +TARBALL=${3:-} +MIN=${4:-1} +if [ -z "$KEYS" ] || [ -z "$SUMS" ] || [ -z "$TARBALL" ]; then + echo "Usage: $0 [min-signatures]" >&2 + exit 1 +fi +[ -f "$SUMS.asc" ] || { echo "$SUMS.asc: no such file" >&2; exit 1; } +[ -f "$TARBALL" ] || { echo "$TARBALL: no such file" >&2; exit 1; } + +# Private keyring: only $KEYS can vouch, and the caller's is untouched. +GNUPGHOME=$(mktemp -d) +export GNUPGHOME +STATUS=$(mktemp) +trap 'rm -rf "$GNUPGHOME" "$STATUS"' EXIT + +gpg --quiet --batch --import "$KEYS"/*.txt + +# Name the manifest explicitly, or an inline-signed .asc would verify +# its own payload instead. Exit status ignored, see above. +gpg --status-fd 3 --verify "$SUMS.asc" "$SUMS" 3>"$STATUS" || true + +if grep -q '^\[GNUPG:\] BADSIG ' "$STATUS"; then + echo "$SUMS.asc: a signature does not match $SUMS" >&2 + exit 1 +fi +GOOD=$(grep -c '^\[GNUPG:\] VALIDSIG ' "$STATUS" || true) +if [ "$GOOD" -lt "$MIN" ]; then + echo "$SUMS.asc: $GOOD good signature(s) from keys in $KEYS, $MIN required" >&2 + exit 1 +fi +echo "$SUMS.asc: $GOOD good signature(s) from keys in $KEYS" + +# The tarball's own line: --ignore-missing would pass if it were unlisted. +NAME=$(basename "$TARBALL") +LINE=$(grep " $NAME\$" "$SUMS") || { + echo "$NAME is not listed in $SUMS" >&2 + exit 1 +} +(cd "$(dirname "$TARBALL")" && echo "$LINE" | sha256sum -c -) From dd84ffb639182e9fb05236681b5cd1af989a6782 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 24 Nov 2026 19:17:05 -0700 Subject: [PATCH 2/4] ci: publish Docker images from a manual workflow, add -signed images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker images leave the release action. The new "Publish Docker images 🐳" workflow is run from the checklist once the release is public: and -vls are built from the tagged source as before, the new -signed installs the GPG-signed release tarball (LIGHTNINGD_FROM=release), requiring two good signatures by default. Running after the release is public means the manifests carry the maintainers' signatures, nothing is published before the release was checked, and any release can be re-published, since the tarballs come from the release page rather than expiring artifacts. docker-build.yml and docker-publish.yml take a `variants` input, build from the tag they label, and refuse -signed for a tag whose Dockerfile predates it. latest is pushed only when asked. Changelog-Added: Docker: `elementsproject/lightningd:v-signed` images install the GPG-signed reproducible release tarballs instead of compiling from source. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/docker-build.yml | 61 ++++++++++++---- .github/workflows/docker-images.yml | 69 +++++++++++++++++++ .github/workflows/docker-publish.yml | 28 +++++--- .github/workflows/release.yml | 34 +-------- .../docker-images.md | 21 ++++++ .../release-checklist.md | 12 ++-- 6 files changed, 161 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/docker-images.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index fb9a51abfa33..8824e2801418 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -12,41 +12,69 @@ on: platforms-to-build: type: string required: true + # JSON array; see the plan job for the known ones. + variants: + type: string + default: '["lightningd", "lightningd-vls-signer"]' + # lightningd-signed: good signatures each manifest must carry. + min-signatures: + type: string + default: '1' jobs: - # Turn the comma-separated platforms-to-build input into a JSON matrix array, - # so we can fan out per-platform without hardcoding the list twice. + # One job per variant and platform. plan: - name: Plan platform matrix + name: Plan build matrix runs-on: ubuntu-24.04 outputs: - platforms: ${{ steps.plan.outputs.platforms }} + matrix: ${{ steps.plan.outputs.matrix }} steps: - id: plan env: PLATFORMS_TO_BUILD: ${{ inputs.platforms-to-build }} + VARIANTS: ${{ inputs.variants }} run: | - IFS=',' read -ra ARR <<< "$PLATFORMS_TO_BUILD" - JSON=$(printf '%s\n' "${ARR[@]}" | jq -R . | jq -sc .) - echo "platforms=$JSON" >> "$GITHUB_OUTPUT" + # variant -> Dockerfile target + LIGHTNINGD_FROM build-arg; + # docker-publish.yml maps it to a tag suffix. + MATRIX=$(jq -nc --arg platforms "$PLATFORMS_TO_BUILD" --argjson variants "$VARIANTS" ' + { + "lightningd": {target: "lightningd", from: "source"}, + "lightningd-vls-signer": {target: "lightningd-vls-signer", from: "source"}, + "lightningd-signed": {target: "lightningd", from: "release"} + } as $known + | [ $variants[] as $v + | ($known[$v] // error("unknown variant \($v)")) + | ($platforms | split(",")[]) as $p + | {variant: $v, target: .target, from: .from, platform: $p} ]') + echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT" build: - name: Build ${{ matrix.target == 'lightningd-vls-signer' && 'vls' || 'normal' }} / ${{ matrix.platform }} + name: Build ${{ matrix.variant }} / ${{ matrix.platform }} needs: plan strategy: fail-fast: false matrix: - target: - - lightningd - - lightningd-vls-signer - platform: ${{ fromJson(needs.plan.outputs.platforms) }} + include: ${{ fromJson(needs.plan.outputs.matrix) }} runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} steps: - name: Checkout repository uses: actions/checkout@v7 with: + # Build the tag the image is labelled with. + ref: ${{ inputs.version }} fetch-depth: 0 + - name: Check this release has the signed image + if: matrix.from == 'release' + env: + VERSION: ${{ inputs.version }} + run: | + # An older Dockerfile would silently compile from source. + if [ ! -f tools/verify-release-tarball.sh ]; then + echo "::error::$VERSION predates the -signed image" + exit 1 + fi + - name: Set up QEMU if: matrix.platform == 'linux/arm/v7' uses: docker/setup-qemu-action@v4 @@ -68,11 +96,14 @@ jobs: file: ./Dockerfile target: ${{ matrix.target }} platforms: ${{ matrix.platform }} + # release mode fetches the tarballs from the GitHub release. build-args: | VERSION=${{ inputs.version }} + LIGHTNINGD_FROM=${{ matrix.from }} + CLN_RELEASE_MIN_SIGNATURES=${{ inputs.min-signatures }} outputs: type=image,name=${{ inputs.dh-repository-owner }}/lightningd,push-by-digest=true,name-canonical=true,push=true - cache-from: type=gha,scope=${{ matrix.target }}-${{ matrix.platform }} - cache-to: type=gha,mode=max,scope=${{ matrix.target }}-${{ matrix.platform }} + cache-from: type=gha,scope=${{ matrix.variant }}-${{ matrix.platform }} + cache-to: type=gha,mode=max,scope=${{ matrix.variant }}-${{ matrix.platform }} - name: Save digest run: | @@ -82,7 +113,7 @@ jobs: - name: Upload digest uses: actions/upload-artifact@v7 with: - name: digest_${{ matrix.target }}_${{ strategy.job-index }} + name: digest_${{ matrix.variant }}_${{ strategy.job-index }} path: /tmp/digests/digest.txt if-no-files-found: error retention-days: 1 diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml new file mode 100644 index 000000000000..2244833166e8 --- /dev/null +++ b/.github/workflows/docker-images.yml @@ -0,0 +1,69 @@ +--- +# https://docs.corelightning.org/docs/release-checklist +# +# Run by hand once the release is public: and -vls are +# built from source, -signed from the GPG-signed release tarballs. +name: "Publish Docker images 🐳" +on: + workflow_dispatch: + inputs: + version: + description: 'Published release tag, e.g. v26.06.9' + required: true + variants: + description: 'Images to publish, as a JSON array' + default: '["lightningd", "lightningd-vls-signer", "lightningd-signed"]' + min-signatures: + description: 'Good signatures each SHA256SUMS manifest must carry from keys in contrib/keys' + default: '2' + dh-repository-owner: + description: 'Dockerhub repository owner' + default: 'elementsproject' + platforms-to-build: + description: 'List of platforms to build' + default: 'linux/amd64,linux/arm64,linux/arm/v7' + push-latest: + description: 'Also tag latest, latest-vls, latest-signed' + type: boolean + default: false + +jobs: + check-release: + name: Check the release is published + runs-on: ubuntu-24.04 + steps: + - name: Release must exist and not be a draft + env: + GH_TOKEN: ${{ github.token }} + # Where the Dockerfile fetches the release from. + GH_REPO: ElementsProject/lightning + VERSION: ${{ inputs.version }} + run: | + # Draft releases serve no assets. + if [ "$(gh release view "$VERSION" --json isDraft --jq .isDraft)" != false ]; then + echo "::error::release $VERSION is a draft or does not exist" + exit 1 + fi + + docker-build: + name: Docker build + needs: check-release + uses: ./.github/workflows/docker-build.yml + with: + version: ${{ inputs.version }} + dh-repository-owner: ${{ inputs.dh-repository-owner }} + platforms-to-build: ${{ inputs.platforms-to-build }} + variants: ${{ inputs.variants }} + min-signatures: ${{ inputs.min-signatures }} + secrets: inherit + + docker-publish: + name: Docker publish + needs: docker-build + uses: ./.github/workflows/docker-publish.yml + with: + version: ${{ inputs.version }} + dh-repository-owner: ${{ inputs.dh-repository-owner }} + push-latest: ${{ github.event.inputs.push-latest }} + variants: ${{ inputs.variants }} + secrets: inherit diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9aee3a2a186a..a62d2e568d67 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -12,19 +12,19 @@ on: push-latest: type: string required: true + # JSON array; see docker-build.yml. + variants: + type: string + default: '["lightningd", "lightningd-vls-signer"]' jobs: publish: - name: Tag and publish ${{ matrix.target }} + name: Tag and publish ${{ matrix.variant }} runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - include: - - target: lightningd - tag_suffix: '' - - target: lightningd-vls-signer - tag_suffix: '-vls' + variant: ${{ fromJson(inputs.variants) }} steps: - name: Setup Docker Buildx uses: docker/setup-buildx-action@v4 @@ -38,7 +38,7 @@ jobs: - name: Download platform digests for this target uses: actions/download-artifact@v8 with: - pattern: digest_${{ matrix.target }}_* + pattern: digest_${{ matrix.variant }}_* path: /tmp/digests merge-multiple: false @@ -47,8 +47,16 @@ jobs: DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }} PUSH_LATEST: ${{ inputs.push-latest }} VERSION: ${{ inputs.version }} - REF_TYPE: ${{ github.ref_type }} + VARIANT: ${{ matrix.variant }} run: | + case "$VARIANT" in + lightningd) TAG_SUFFIX="";; + lightningd-vls-signer) TAG_SUFFIX="-vls";; + lightningd-signed) TAG_SUFFIX="-signed";; + *) echo "unknown variant $VARIANT" >&2; exit 1;; + esac + echo "TAG_SUFFIX=$TAG_SUFFIX" >> $GITHUB_ENV + DIGEST_REFS="" for f in /tmp/digests/*/digest.txt; do D=$(cat "$f") @@ -56,8 +64,7 @@ jobs: done echo "DIGEST_REFS=$DIGEST_REFS" >> $GITHUB_ENV - if [[ "$PUSH_LATEST" == "true" ]] || - ([[ "$REF_TYPE" == "tag" ]] && [[ ! "$VERSION" =~ rc ]]); then + if [[ "$PUSH_LATEST" == "true" ]]; then echo "PUSHLATEST=true" >> $GITHUB_ENV else echo "PUSHLATEST=false" >> $GITHUB_ENV @@ -67,7 +74,6 @@ jobs: env: DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }} VERSION: ${{ inputs.version }} - TAG_SUFFIX: ${{ matrix.tag_suffix }} run: | TAG_ARGS=(-t "${DH_REPOSITORY_OWNER}/lightningd:${VERSION}${TAG_SUFFIX}") if [[ "$PUSHLATEST" == "true" ]]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7bb09de679b8..04e8ac811b2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,16 +21,6 @@ on: description: Create a draft release default: false type: boolean - dh-repository-owner: - description: 'Dockerhub repository owner' - default: 'elementsproject' - platforms-to-build: - description: 'List of platforms to build' - default: 'linux/amd64,linux/arm64,linux/arm/v7' - push-latest: - description: 'Push the latest Docker tag' - type: boolean - default: false dist-location: description: 'PyPI distribution location' type: choice @@ -48,16 +38,6 @@ jobs: skip_validation: ${{ github.event.inputs.skip_validation == 'true' }} - docker-build: - name: Docker build - needs: check-version - uses: ./.github/workflows/docker-build.yml - with: - version: ${{ needs.check-version.outputs.version }} - dh-repository-owner: ${{ github.event.inputs.dh-repository-owner || 'elementsproject' }} - platforms-to-build: ${{ github.event.inputs.platforms-to-build || 'linux/amd64,linux/arm64,linux/arm/v7' }} - secrets: inherit - pypi-build: name: PyPI build needs: check-version @@ -77,20 +57,10 @@ jobs: gate: name: All builds succeeded - needs: [docker-build, pypi-build, release-build] + needs: [pypi-build, release-build] runs-on: ubuntu-24.04 steps: - - run: echo "All three build paths succeeded — proceeding to publish." - - docker-publish: - name: Docker publish - needs: [check-version, gate] - uses: ./.github/workflows/docker-publish.yml - with: - version: ${{ needs.check-version.outputs.version }} - dh-repository-owner: ${{ github.event.inputs.dh-repository-owner || 'elementsproject' }} - push-latest: ${{ github.event.inputs.push-latest }} - secrets: inherit + - run: echo "All build paths succeeded — proceeding to publish." pypi-publish: name: PyPI publish diff --git a/doc/contribute-to-core-lightning/docker-images.md b/doc/contribute-to-core-lightning/docker-images.md index 99e1bf1211a1..0914da78e1f5 100644 --- a/doc/contribute-to-core-lightning/docker-images.md +++ b/doc/contribute-to-core-lightning/docker-images.md @@ -75,12 +75,33 @@ Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/38 ``` # Building/publishing images on Dockerhub + +The release images on Docker Hub are published by the `Publish Docker images 🐳` GitHub action (`.github/workflows/docker-images.yml`), run by hand with the release tag once the GitHub release is public. It builds `elementsproject/lightningd:v` and `v-vls` from the tagged source and `v-signed` from the release tarballs (see the next section), and the `latest`, `latest-vls` and `latest-signed` tags when `push-latest` is checked. To build and publish from your own machine instead: + 1. Ensure that your multiarch setup is working 2. Run script `tools/build-release.sh --push docker` to build `amd64`, `arm64v8`, `latest` and `multiarch` images and publish them on Dockerhub. 3. If you do not want to push the images directly on Dockerhub then run `tools/build-release.sh docker`. It will only create images locally but not push them to Dockerhub. +# Building an image from a release + +`docker build` compiles the checkout. For a tagged release the image can instead install the reproducibly built tarball the release carries, after checking it against `SHA256SUMS-v` and the signatures in `SHA256SUMS-v.asc` with the maintainer keys in `contrib/keys` (`tools/verify-release-tarball.sh` does the checking). The `Publish Docker images 🐳` action publishes such an image as `elementsproject/lightningd:v-signed` (and `latest-signed`) next to the source-built ones. Because it runs once the release is public, the manifests it checks carry the maintainers' signatures and not only the CI release key's, and it can be re-run for any published release. + +What `-signed` promises: the manifest carried the required number of good signatures from keys in `contrib/keys` (the action requires two by default, a local build one) and no bad one (signatures from other keys are ignored), the tarball matched its line in the manifest, and the binaries were installed as they are, not stripped, so `sha256sum /usr/local/bin/lightningd` in the image equals the file in the tarball anyone can download and verify. + +```shell +docker build --build-arg LIGHTNINGD_FROM=release --build-arg VERSION=v26.06.9 -t lightningd:v26.06.9 . +``` + +Add `--build-arg CLN_RELEASE_MIN_SIGNATURES=2` to require more than one signature. The tarball, manifest and signatures are fetched from the GitHub release. To use copies you already have, put them in a directory and pass it as the `cln-release` build context: + +```shell +docker build --build-arg LIGHTNINGD_FROM=release --build-arg VERSION=v26.06.9 --build-context cln-release=./release -t lightningd:v26.06.9 . +``` + +Each platform installs the Ubuntu 22.04 tarball for its architecture (`amd64`, `arm64` or `armv7`). The arm64 and armv7 tarballs have their own manifests, `SHA256SUMS-v-arm64` and `SHA256SUMS-v-armv7`, so a multi-platform build needs those (and their `.asc` files) in the directory too. + # Miscellaneous ## Testing Docker image diff --git a/doc/contribute-to-core-lightning/release-checklist.md b/doc/contribute-to-core-lightning/release-checklist.md index b669bc67851f..18b5db2966fb 100644 --- a/doc/contribute-to-core-lightning/release-checklist.md +++ b/doc/contribute-to-core-lightning/release-checklist.md @@ -40,7 +40,7 @@ Here's a checklist for the release process. 10. Prepare release notes draft including the contributor list from above, and share with the team for editing. 11. Upgrade your personal nodes to the rc1, to help testing. 12. Github action `Publish Python 🐍 distributions 📦 to PyPI and TestPyPI` uploads the pyln modules on test PyPI server. Make sure that the action has been triggered with RC tag and that the modules have been published on `https://test.pypi.org/project/pyln-*/#history`. -13. Docker image publishing is handled by the GitHub action `Build and push multi-platform docker images`. Ensure that this action is triggered and that the RC image has been successfully uploaded to Docker Hub after the action completes. Alternatively, you can publish Docker images by running the `tools/build-release.sh docker` script. The GitHub action takes approximately 3-4 hours, while the script takes about 6-7 hours. It is highly recommended to test your Docker setup if you haven't done so before. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static). +13. Once the pre-release is published (no longer a draft), run the `Publish Docker images 🐳` GitHub action with the version. It builds `elementsproject/lightningd:vrc1` and `vrc1-vls` from the tagged source, and `vrc1-signed` from the release tarballs after `tools/verify-release-tarball.sh` has checked them against the `SHA256SUMS` manifests, their signatures and the keys in `contrib/keys` (`min-signatures` defaults to 2: the CI key's and yours from step 7). Ensure that the RC images have been successfully uploaded to Docker Hub after the action completes. Alternatively, you can publish the source-built images by running the `tools/build-release.sh docker` script. The GitHub action takes approximately 3-4 hours, while the script takes about 6-7 hours. It is highly recommended to test your Docker setup if you haven't done so before. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static). ## Releasing -rc2, ..., -rcN @@ -54,7 +54,7 @@ Here's a checklist for the release process. 8. After confirming the local and pre-release `SHA256SUMS-v` files match, append your signatures to the pre-release's `SHA256SUMS-v.asc` file to formally attest to the build's validity. 9. Announce tagged rc release on core-lightning's release-chat channel on Discord & Telegram. 10. Upgrade your personal nodes to the rcN. -11. Confirm that Github actions for PyPI and Docker publishing are working as expected. +11. Confirm that the PyPI GitHub action worked, then publish the Docker images as for rc1 (step 13 above). ## Tagging the Release @@ -87,14 +87,14 @@ Here's a checklist for the release process. - `export UV_PUBLISH_TOKEN=` - `uv run make pyln-release-client` - ... repeat for each pyln package with the appropriate token. -14. Publish multi-arch Docker images (`elementsproject/lightningd:v${VERSION}` and `elementsproject/lightningd:latest`) to Docker Hub either using the GitHub action `Build and push multi-platform docker images` or by running the `tools/build-release.sh docker` script. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static). ## Performing the Release 1. Edit the GitHub draft and include the `SHA256SUMS-v.asc` file. 2. Publish the release as not a draft. -3. Announce the final release on core-lightning's release-chat channel on Discord & Telegram. -4. Write release blog, post it on [Blockstream](https://blog.blockstream.com/) and announce the release on Twitter. +3. Run the `Publish Docker images 🐳` GitHub action with the version and `push-latest` checked. It publishes `elementsproject/lightningd:v` and `v-vls`, built from the tagged source, and `v-signed`, which installs the reproducibly built release tarballs after `tools/verify-release-tarball.sh` has checked them against the `SHA256SUMS` manifests, the signatures from step 1 and the keys in `contrib/keys`, plus the `latest`, `latest-vls` and `latest-signed` tags. It needs the published release, so it cannot run earlier, and takes approximately 3-4 hours. Alternatively, the source-built images can be published by running the `tools/build-release.sh docker` script. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static). +4. Announce the final release on core-lightning's release-chat channel on Discord & Telegram. +5. Write release blog, post it on [Blockstream](https://blog.blockstream.com/) and announce the release on Twitter. ## Post-release @@ -125,6 +125,6 @@ Here's a checklist for the release process. 12. Share the `SHA256SUMS-v` and `SHA256SUMS-v.asc` files with the team for verification and signing. 13. Append the signatures received from the team to the `SHA256SUMS-v.asc` file. Verify the file using `gpg --verify SHA256SUMS-v.asc SHA256SUMS-v`; the manifest must be passed as the second argument, otherwise `gpg` may verify a payload embedded in the `.asc` and exit successfully without ever reading the checksums. Then re-upload the file. 14. Finalize and publish the release (change it from draft to public). -15. Ensure that the GitHub Actions for `Publish Python 🐍 distributions 📦 to PyPI and TestPyPI` and `Build and push multi-platform docker images` are functioning correctly. Check that the `PyPI` modules published on `https://pypi.org/project/pyln-*` and that the Docker image has been uploaded to Docker Hub. +15. Ensure that the GitHub Action `Publish Python 🐍 distributions 📦 to PyPI and TestPyPI` is functioning correctly and that the `PyPI` modules were published on `https://pypi.org/project/pyln-*`. Then run the `Publish Docker images 🐳` action with the version (and `push-latest` checked if this is the newest release) and check that the Docker images have been uploaded to Docker Hub. 16. Create a PR to merge updates from `update-versions` and `CHANGELOG.md` into `master` to keep it up-to-date for the next release. 17. Announce the hotfix release in the core-lightning release-chat channel on Discord and on Telegram. From e11b1d498028e0519e5cfff3478963542abd0f41 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 24 Nov 2026 19:17:06 -0700 Subject: [PATCH 3/4] ci: sign the published Docker images with cosign Keyless, under the publish workflow's GitHub OIDC identity. The signature is attached to the image on Docker Hub as an OCI referrer and recorded in Rekor; the publish job and its caller get id-token: write, no new secrets. The installation guide documents verifying the signature and, for -signed images, the contents against the GPG-signed tarball. Changelog-Added: Docker: published images are signed with cosign; the installation guide describes how to verify them. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/docker-images.yml | 5 ++++ .github/workflows/docker-publish.yml | 19 ++++++++++++++ .../docker-images.md | 2 +- .../getting-started/installation.md | 26 +++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 2244833166e8..9c7f03680f67 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -60,6 +60,11 @@ jobs: docker-publish: name: Docker publish needs: docker-build + # id-token for cosign; a called workflow cannot exceed the caller's. + permissions: + contents: read + actions: read + id-token: write uses: ./.github/workflows/docker-publish.yml with: version: ${{ inputs.version }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a62d2e568d67..a3e5e54faf56 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -21,6 +21,10 @@ jobs: publish: name: Tag and publish ${{ matrix.variant }} runs-on: ubuntu-22.04 + permissions: + contents: read + actions: read + id-token: write # cosign keyless signing strategy: fail-fast: false matrix: @@ -80,3 +84,18 @@ jobs: TAG_ARGS+=(-t "${DH_REPOSITORY_OWNER}/lightningd:latest${TAG_SUFFIX}") fi docker buildx imagetools create "${TAG_ARGS[@]}" $DIGEST_REFS + + - name: Install cosign + uses: sigstore/cosign-installer@v4.1.4 + + # Keyless, under this workflow's OIDC identity; one signature covers + # every tag of the digest, --recursive the per-platform manifests too. + # Verification: doc/getting-started/getting-started/installation.md + - name: Sign the published image + env: + DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }} + VERSION: ${{ inputs.version }} + run: | + IMAGE="${DH_REPOSITORY_OWNER}/lightningd" + DIGEST=$(docker buildx imagetools inspect "${IMAGE}:${VERSION}${TAG_SUFFIX}" --format '{{.Manifest.Digest}}') + cosign sign --yes --recursive "${IMAGE}@${DIGEST}" diff --git a/doc/contribute-to-core-lightning/docker-images.md b/doc/contribute-to-core-lightning/docker-images.md index 0914da78e1f5..45303deedeb1 100644 --- a/doc/contribute-to-core-lightning/docker-images.md +++ b/doc/contribute-to-core-lightning/docker-images.md @@ -76,7 +76,7 @@ Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/38 # Building/publishing images on Dockerhub -The release images on Docker Hub are published by the `Publish Docker images 🐳` GitHub action (`.github/workflows/docker-images.yml`), run by hand with the release tag once the GitHub release is public. It builds `elementsproject/lightningd:v` and `v-vls` from the tagged source and `v-signed` from the release tarballs (see the next section), and the `latest`, `latest-vls` and `latest-signed` tags when `push-latest` is checked. To build and publish from your own machine instead: +The release images on Docker Hub are published by the `Publish Docker images 🐳` GitHub action (`.github/workflows/docker-images.yml`), run by hand with the release tag once the GitHub release is public. It builds `elementsproject/lightningd:v` and `v-vls` from the tagged source and `v-signed` from the release tarballs (see the next section), and the `latest`, `latest-vls` and `latest-signed` tags when `push-latest` is checked. It signs each published image with cosign (keyless, under the workflow's GitHub identity); the installation guide shows how users verify that. To build and publish from your own machine instead: 1. Ensure that your multiarch setup is working diff --git a/doc/getting-started/getting-started/installation.md b/doc/getting-started/getting-started/installation.md index 129a23ddc734..bf9537576b2c 100644 --- a/doc/getting-started/getting-started/installation.md +++ b/doc/getting-started/getting-started/installation.md @@ -44,6 +44,32 @@ docker run --rm --init -v /path/on/host/lightning-data:/root/.lightning -p 9735: See all of the docker images for Core Lightning on [Docker Hub](https://hub.docker.com/r/elementsproject/lightningd/tags). +## Verifying the Docker image + +Two checks are available. The first works for every image published by the release workflow, the second only for the `-signed` images. Images published before the workflow existed have no signature. + +**Who published it.** Each image is signed with [cosign](https://docs.sigstore.dev/cosign/) by the GitHub Actions workflow that pushes it. This confirms that the image under a tag is the one that workflow pushed, and not something uploaded by someone else with access to the repository: + +```shell +cosign verify \ + --certificate-oidc-issuer https://token.actions.githubusercontent.com \ + --certificate-identity-regexp '^https://github.com/ElementsProject/lightning/\.github/workflows/docker-publish\.yml@' \ + elementsproject/lightningd:v +``` + +On success it lists the checks it performed, prints the signature as JSON and exits 0. A missing or foreign signature fails with `no matching signatures`. + +**What is inside.** The `v-signed` images (and `latest-signed`) install the reproducibly built release tarball unchanged, so every file it contains is byte for byte the one in `clightning-v-Ubuntu-22.04-.tar.xz` (`amd64`, `arm64` or `armv7`), whose checksum is in the GPG-signed `SHA256SUMS-v` of the GitHub release. First verify the tarball itself as described in [Verifying a reproducible build](https://docs.corelightning.org/docs/repro#verifying-a-reproducible-build), then compare its contents with the image: + +```shell +mkdir tarball && tar xJf clightning-v-Ubuntu-22.04-amd64.tar.xz -C tarball +(cd tarball/usr && find . -type f -exec sha256sum {} +) > tarball.sha256 +docker run --rm -v "$PWD/tarball.sha256:/tarball.sha256:ro" --entrypoint sh \ + elementsproject/lightningd:v-signed -c 'cd /usr/local && sha256sum -c /tarball.sha256' +``` + +Every line should end in `OK`. A `FAILED` or missing file means the image does not ship the signed release; do not use it, and contact the maintainers. The base operating system, `bitcoin-cli` and the shared libraries in the image are not covered by this check, only by the cosign signature. + # Third-party apps For a GUI experience, you can install and use Core Lightning via a variety of third-party applications such as [Ride the Lightning](https://www.ridethelightning.info/), [Umbrel](https://getumbrel.com/), [BTCPayServer](https://btcpayserver.org/), [Raspiblitz](https://raspiblitz.org/), and [Start9](https://start9.com/). From cb89f848fa18b5dcfd5a64aaf36e698517ee95cb Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 24 Nov 2026 19:43:01 -0700 Subject: [PATCH 4/4] tools: remove the docker target from build-release.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Publish Docker images 🐳" workflow is the only publish path now. This target pushed unsigned, source-built images under the official name with an unconditional latest tag. --sudo and --no-push applied to nothing else, so they go with it. Co-Authored-By: Claude Fable 5.1 --- .../docker-images.md | 8 +--- .../release-checklist.md | 9 ++-- tools/build-release.sh | 46 ++----------------- 3 files changed, 9 insertions(+), 54 deletions(-) diff --git a/doc/contribute-to-core-lightning/docker-images.md b/doc/contribute-to-core-lightning/docker-images.md index 45303deedeb1..48dd926a2eb8 100644 --- a/doc/contribute-to-core-lightning/docker-images.md +++ b/doc/contribute-to-core-lightning/docker-images.md @@ -76,13 +76,9 @@ Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/38 # Building/publishing images on Dockerhub -The release images on Docker Hub are published by the `Publish Docker images 🐳` GitHub action (`.github/workflows/docker-images.yml`), run by hand with the release tag once the GitHub release is public. It builds `elementsproject/lightningd:v` and `v-vls` from the tagged source and `v-signed` from the release tarballs (see the next section), and the `latest`, `latest-vls` and `latest-signed` tags when `push-latest` is checked. It signs each published image with cosign (keyless, under the workflow's GitHub identity); the installation guide shows how users verify that. To build and publish from your own machine instead: +The release images on Docker Hub are published by the `Publish Docker images 🐳` GitHub action (`.github/workflows/docker-images.yml`), run by hand with the release tag once the GitHub release is public. It builds `elementsproject/lightningd:v` and `v-vls` from the tagged source and `v-signed` from the release tarballs (see the next section), and the `latest`, `latest-vls` and `latest-signed` tags when `push-latest` is checked. It signs each published image with cosign (keyless, under the workflow's GitHub identity); the installation guide shows how users verify that. -1. Ensure that your multiarch setup is working - -2. Run script `tools/build-release.sh --push docker` to build `amd64`, `arm64v8`, `latest` and `multiarch` images and publish them on Dockerhub. - -3. If you do not want to push the images directly on Dockerhub then run `tools/build-release.sh docker`. It will only create images locally but not push them to Dockerhub. +To build the same images on your own machine, use `docker build` with the build-args shown in the next section (omit `LIGHTNINGD_FROM` for a source build). For several platforms at once, use `docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7` with the Buildx and QEMU setup above. # Building an image from a release diff --git a/doc/contribute-to-core-lightning/release-checklist.md b/doc/contribute-to-core-lightning/release-checklist.md index 18b5db2966fb..965de5a7c062 100644 --- a/doc/contribute-to-core-lightning/release-checklist.md +++ b/doc/contribute-to-core-lightning/release-checklist.md @@ -40,7 +40,7 @@ Here's a checklist for the release process. 10. Prepare release notes draft including the contributor list from above, and share with the team for editing. 11. Upgrade your personal nodes to the rc1, to help testing. 12. Github action `Publish Python 🐍 distributions 📦 to PyPI and TestPyPI` uploads the pyln modules on test PyPI server. Make sure that the action has been triggered with RC tag and that the modules have been published on `https://test.pypi.org/project/pyln-*/#history`. -13. Once the pre-release is published (no longer a draft), run the `Publish Docker images 🐳` GitHub action with the version. It builds `elementsproject/lightningd:vrc1` and `vrc1-vls` from the tagged source, and `vrc1-signed` from the release tarballs after `tools/verify-release-tarball.sh` has checked them against the `SHA256SUMS` manifests, their signatures and the keys in `contrib/keys` (`min-signatures` defaults to 2: the CI key's and yours from step 7). Ensure that the RC images have been successfully uploaded to Docker Hub after the action completes. Alternatively, you can publish the source-built images by running the `tools/build-release.sh docker` script. The GitHub action takes approximately 3-4 hours, while the script takes about 6-7 hours. It is highly recommended to test your Docker setup if you haven't done so before. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static). +13. Once the pre-release is published (no longer a draft), run the `Publish Docker images 🐳` GitHub action with the version. It builds `elementsproject/lightningd:vrc1` and `vrc1-vls` from the tagged source, and `vrc1-signed` from the release tarballs after `tools/verify-release-tarball.sh` has checked them against the `SHA256SUMS` manifests, their signatures and the keys in `contrib/keys` (`min-signatures` defaults to 2: the CI key's and yours from step 7). It takes approximately 3-4 hours; ensure that the RC images have been uploaded to Docker Hub after it completes. ## Releasing -rc2, ..., -rcN @@ -68,13 +68,12 @@ Here's a checklist for the release process. - Push the tag: `git push origin v$VERSION` 5. Pushing the tag will trigger the CI pipeline, which will draft the pre-release and upload the build artifacts with project-signed checksums. 6. Prepare the build environments by executing the `contrib/cl-repro.sh` script. -7. Run `tools/build-release.sh bin-Fedora bin-Ubuntu sign` (with `--sudo` if you need root to run Docker) to: +7. Run `tools/build-release.sh bin-Fedora bin-Ubuntu sign` to: - Create reproducible zipfile - Build reproducible Fedora image - Build reproducible Ubuntu-v22.04, Ubuntu-v24.04 and Ubuntu-v26.04 images. Follow [link](https://docs.corelightning.org/docs/repro#building-using-the-builder-image) for manually Building Ubuntu Images. - - Build Docker images for amd64 and arm64v8. Follow [link](https://docs.corelightning.org/docs/docker-images) for more details on Docker publishing. - Create and sign checksums. Follow [link](https://docs.corelightning.org/docs/repro#co-signing-the-release-manifest) for manually signing the release. -8. If you used `--sudo`, the tarballs may be owned by root, so revert ownership if necessary: `sudo chown ${USER}:${USER} *${VERSION}*` +8. The tarballs may be owned by root, so revert ownership if necessary: `sudo chown ${USER}:${USER} *${VERSION}*` 9. Verify the checksums match the pre-release `SHA256SUMS-v`, then append your signatures to the official signature `SHA256SUMS-v.asc` file to confirm the build's integrity. 10. Send `SHA256SUMS-v` & `SHA256SUMS-v.asc` files to the rest of the team to check and sign the release. 11. Team members can verify the release with the help of `build-release.sh`: @@ -92,7 +91,7 @@ Here's a checklist for the release process. 1. Edit the GitHub draft and include the `SHA256SUMS-v.asc` file. 2. Publish the release as not a draft. -3. Run the `Publish Docker images 🐳` GitHub action with the version and `push-latest` checked. It publishes `elementsproject/lightningd:v` and `v-vls`, built from the tagged source, and `v-signed`, which installs the reproducibly built release tarballs after `tools/verify-release-tarball.sh` has checked them against the `SHA256SUMS` manifests, the signatures from step 1 and the keys in `contrib/keys`, plus the `latest`, `latest-vls` and `latest-signed` tags. It needs the published release, so it cannot run earlier, and takes approximately 3-4 hours. Alternatively, the source-built images can be published by running the `tools/build-release.sh docker` script. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static). +3. Run the `Publish Docker images 🐳` GitHub action with the version and `push-latest` checked. It publishes `elementsproject/lightningd:v` and `v-vls`, built from the tagged source, and `v-signed`, which installs the reproducibly built release tarballs after `tools/verify-release-tarball.sh` has checked them against the `SHA256SUMS` manifests, the signatures from step 1 and the keys in `contrib/keys`, plus the `latest`, `latest-vls` and `latest-signed` tags. It needs the published release, so it cannot run earlier, and takes approximately 3-4 hours. 4. Announce the final release on core-lightning's release-chat channel on Discord & Telegram. 5. Write release blog, post it on [Blockstream](https://blog.blockstream.com/) and announce the release on Twitter. diff --git a/tools/build-release.sh b/tools/build-release.sh index b9ddac8a54f6..8268ee48c7e6 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -31,11 +31,9 @@ fi FORCE_UNCLEAN=false VERIFY_RELEASE=false WITHOUT_ZIP=false -NO_PUSH=false -SUDO= -ALL_TARGETS="bin-Fedora bin-Ubuntu docker sign" -# ALL_TARGETS="bin-Fedora bin-Ubuntu tarball deb docker sign" +ALL_TARGETS="bin-Fedora bin-Ubuntu sign" +# ALL_TARGETS="bin-Fedora bin-Ubuntu tarball deb sign" TARGETS="" @@ -64,21 +62,13 @@ while [ $# -gt 0 ]; do --without-zip) WITHOUT_ZIP=true ;; - --no-push) - NO_PUSH=true - ;; - --sudo) - SUDO=sudo - ;; --help) - echo "Usage: [--force-version=] [--force-unclean] [--force-mtime=YYYY-MM-DD] [--verify] [--no-push] [TARGETS]" + echo "Usage: [--force-version=] [--force-unclean] [--force-mtime=YYYY-MM-DD] [--verify] [TARGETS]" echo Known targets: "$ALL_TARGETS" echo "Example: tools/build-release.sh" echo "Example: tools/build-release.sh --force-version=v23.05 --force-unclean --force-mtime=2023-05-01 bin-Fedora bin-Ubuntu sign" echo "Example: tools/build-release.sh --verify" echo "Example: tools/build-release.sh --force-version=v23.05 --force-unclean --force-mtime=2023-05-01 --verify" - echo "Example: tools/build-release.sh docker" - echo "Example: tools/build-release.sh --force-version=v23.05 --force-unclean --force-mtime=2023-05-01 docker" exit 0 ;; -*) @@ -239,36 +229,6 @@ for target in $TARGETS; do esac done -if [ -z "${TARGETS##* docker *}" ] || [ -z "${TARGETS##* docker}" ]; then - echo "Building Docker Images" - DOCKER_USER="elementsproject" - echo "Creating multi-platform images tagged as $VERSION and latest" - if $NO_PUSH; then - # Build without publishing: the result only populates the builder's - # cache, so a later run without --no-push pushes from cache quickly. - DOCKER_OPTS="--platform linux/amd64,linux/arm64,linux/arm/v7" - else - DOCKER_OPTS="--push --platform linux/amd64,linux/arm64,linux/arm/v7" - fi - DOCKER_OPTS="$DOCKER_OPTS --build-arg VERSION=$VERSION" - DOCKER_OPTS="$DOCKER_OPTS -t $DOCKER_USER/lightningd:$VERSION" - DOCKER_OPTS="$DOCKER_OPTS -t $DOCKER_USER/lightningd:latest" - DOCKER_OPTS="$DOCKER_OPTS --cache-to=type=local,dest=/tmp/docker-cache --cache-from=type=local,src=/tmp/docker-cache" - echo "Docker Options: $DOCKER_OPTS" - if $SUDO docker buildx ls | grep -q 'cln-builder'; then - $SUDO docker buildx use cln-builder - else - $SUDO docker buildx create --name=cln-builder --use - fi - # shellcheck disable=SC2086 - $SUDO docker buildx build $DOCKER_OPTS . - if $NO_PUSH; then - echo "Built multi-platform images without pushing (rerun without --no-push to publish)" - else - echo "Pushed multi-platform images tagged as $VERSION and latest" - fi -fi - if [ -z "${TARGETS##* sign *}" ] || [ -z "${TARGETS##* sign}" ]; then echo "Signing Release" cd release/ || exit