chore(docker): Node docker image use release binaries (#2154)

This commit is contained in:
gusto
2026-02-10 10:07:44 +02:00
committed by GitHub
parent 19d0dfc5b2
commit 918ac6004d
5 changed files with 95 additions and 63 deletions
-22
View File
@@ -224,25 +224,3 @@ jobs:
name: integration-test-artifacts-${{ runner.os }}-${{ github.sha }}
include-hidden-files: true
path: tests/.tmp*
build-docker:
name: Docker build
if: ${{ !startsWith(github.event.pull_request.title, '[WIP]') && !contains(github.event.label.name, 'DO NOT MERGE') }}
needs:
- formatting
- cargo-deny
- unused-deps
- lints
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # Version 4.2.2
- name: Setup docker buildx
uses: docker/setup-buildx-action@afeb29a6e0d7d6258844ecabe6eba67d13443680 # Version 3.1.0
- name: Build Docker Image
uses: docker/build-push-action@84ad562665bb303b549fec655d1b64f9945f3f91 # Version 6.15.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: false
+66
View File
@@ -0,0 +1,66 @@
name: Publish Logos Blockchain Node Docker Image
on:
release:
types: [published, created]
env:
REGISTRY: ghcr.io
IMAGE_NAME: logos-blockchain-node
jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # Version 4.2.2
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # Version 3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@afeb29a6e0d7d6258844ecabe6eba67d13443680 # Version 3.10.0
with:
driver: docker-container
install: true
- name: Log in to the Container registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # Version 3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # Version 5.7.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push multi-platform Docker images
id: push
uses: docker/build-push-action@84ad562665bb303b549fec655d1b64f9945f3f91 # Version 6.15.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@9d3beef6515cb82652d066f999b94affc15acfac # Version 2.2.3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
+12 -27
View File
@@ -2,57 +2,42 @@
# check=skip=SecretsUsedInArgOrEnv
# Ignore warnings about sensitive information as this is test data.
ARG VERSION=v0.2.0
ARG LB_CIRCUITS_VERSION=v0.4.1
ARG LB_NODE_VERSION=0.1.1
# ===========================
# BUILD IMAGE
# ===========================
FROM rust:1.93.0-slim-bookworm AS builder
FROM alpine:latest AS builder
ARG VERSION
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-blockchain/logos-blockchain" \
description="Logos blockchain node build image"
ARG LB_CIRCUITS_VERSION
ARG LB_NODE_VERSION
WORKDIR /logos-blockchain
COPY . .
# Install dependencies needed for building RocksDB.
RUN apt-get update && apt-get install -yq \
git gcc g++ clang libssl-dev pkg-config ca-certificates curl
RUN chmod +x scripts/setup-logos-blockchain-circuits.sh && \
scripts/setup-logos-blockchain-circuits.sh "$VERSION" "/opt/circuits"
ENV LOGOS_BLOCKCHAIN_CIRCUITS=/opt/circuits
RUN cargo build --locked --release -p logos-blockchain-node
RUN apk add --no-cache curl bash
RUN scripts/setup-logos-blockchain-circuits.sh "$LB_CIRCUITS_VERSION" "/opt/circuits"
RUN scripts/setup-logos-blockchain-node.sh "$LB_NODE_VERSION" "linux-$(uname -m)"
# ===========================
# NODE IMAGE
# ===========================
FROM debian:bookworm-slim
FROM debian:trixie-slim
ARG VERSION
ARG LB_CIRCUITS_VERSION
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-blockchain/logos-blockchain" \
description="Logos blockchain node image"
RUN apt-get update && apt-get install -yq \
libstdc++6 \
libssl3 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/circuits /opt/circuits
COPY --from=builder /logos-blockchain/target/release/logos-blockchain-node /usr/local/bin/logos-blockchain-node
COPY --from=builder /usr/local/bin/logos-blockchain-node /usr/local/bin/logos-blockchain-node
ENV LOGOS_BLOCKCHAIN_CIRCUITS=/opt/circuits
EXPOSE 3000 8080 9000 60000
ENTRYPOINT ["logos-blockchain-node"]
ENTRYPOINT ["logos-blockchain-node"]
+2 -14
View File
@@ -178,7 +178,7 @@ Currently the `"profiling"` feature is not supported in Windows builds.
To build the Logos blockchain Docker image, run:
```bash
docker build -t logos-blockchain .
docker build -t logos-blockchain-node .
```
#### Command line
@@ -236,19 +236,7 @@ To run a docker container with the Logos blockchain node you need to mount both
the configuration.
```bash
docker run -v "/path/to/config.yml" -v "/path/to/global_params:global/params/path" logos-blockchain /etc/logos-blockchain/config.yml
```
To use an example configuration located at `nodes/node/config.yaml`, first run the test that generates the random
kzgrs file and then run the docker container with the appropriate config and global params:
```bash
cargo test --package logos-blockchain-kzgrs-backend write_random_kzgrs_params_to_file -- --ignored
docker run -v "$(pwd)/nodes/node/config.yaml:/etc/logos-blockchain/config.yml" \
-v "$(pwd)/logos-blockchain-da/kzgrs-backend/kzgrs_test_params:/app/tests/kzgrs/kzgrs_test_params" \
logos-blockchain /etc/logos-blockchain/config.yml
docker run -v "/path/to/config.yml:/config.yml" logos-blockchain-node /config.yml
```
#### Running Logos Blockchain Node locally
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
VERSION="${1:-0.1.1}"
PLATFORM="${2:-linux-x86_64}"
OUT_PATH="${3:-/usr/local/bin}/logos-blockchain-node"
echo "Installing Logos Node $VERSION ($PLATFORM) to $OUT_PATH."
curl -Lfo "$OUT_PATH" --create-dirs \
"https://github.com/logos-blockchain/logos-blockchain/releases/download/$VERSION/logos-blockchain-node-$PLATFORM-$VERSION"
chmod +x "$OUT_PATH"
echo "Done."