From a9228b9c9aaec11c02441f54a70073681addb27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:04:54 -0300 Subject: [PATCH 1/2] feat: add labels to docker image --- Dockerfile | 14 ++++++++++---- Makefile | 8 +++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 307efa8..7cc43ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,6 @@ WORKDIR /app RUN cargo install cargo-chef RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config -LABEL org.opencontainers.image.source=https://github.com/lambdaclass/ethlambda -LABEL org.opencontainers.image.description="ethlambda is a modular Ethereum beam chain client." -LABEL org.opencontainers.image.licenses="MIT" - # Builds a cargo-chef plan FROM chef AS planner COPY --exclude=.git --exclude=target . . @@ -46,6 +42,16 @@ RUN cp /app/target/$BUILD_PROFILE/ethlambda /app/ethlambda FROM ubuntu AS runtime WORKDIR /app +LABEL org.opencontainers.image.source=https://github.com/lambdaclass/ethlambda +LABEL org.opencontainers.image.description="Minimalist, fast and modular implementation of the Lean Ethereum client written in Rust." +LABEL org.opencontainers.image.licenses="MIT" + +ARG GIT_COMMIT=unknown +ARG GIT_BRANCH=unknown + +LABEL org.opencontainers.image.revision=$GIT_COMMIT +LABEL org.opencontainers.image.ref.name=$GIT_BRANCH + # Copy ethlambda over from the build stage COPY --from=builder /app/ethlambda /usr/local/bin diff --git a/Makefile b/Makefile index 5f745cb..0b405d8 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,14 @@ test: ## 🧪 Run all tests, then forkchoice tests with skip-signature-verificat cargo test --workspace cargo test -p ethlambda-blockchain --features skip-signature-verification --test forkchoice_spectests +GIT_COMMIT=$(shell git rev-parse HEAD) +GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) + docker-build: ## 🐳 Build the Docker image - docker build -t ghcr.io/lambdaclass/ethlambda:local . + docker build \ + --build-arg GIT_COMMIT=$(GIT_COMMIT) \ + --build-arg GIT_BRANCH=$(GIT_BRANCH) \ + -t ghcr.io/lambdaclass/ethlambda:local . LEAN_SPEC_COMMIT_HASH:=fbbacbea4545be870e25e3c00a90fc69e019c5bb From d6f9c9f72556d5fa4ba6bac805567456af1cdcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:08:25 -0300 Subject: [PATCH 2/2] ci: add build-args to docker build action --- .github/workflows/docker_publish.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker_publish.yaml b/.github/workflows/docker_publish.yaml index ed6699a..12f4a60 100644 --- a/.github/workflows/docker_publish.yaml +++ b/.github/workflows/docker_publish.yaml @@ -47,6 +47,9 @@ jobs: with: context: . file: ./Dockerfile + build-args: | + GIT_COMMIT=${{ github.sha }} + GIT_BRANCH=${{ github.ref_name }} push: true tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }}-${{ matrix.arch }} platforms: linux/${{ matrix.arch }}