Skip to content

Commit a9228b9

Browse files
committed
feat: add labels to docker image
1 parent 5d0bae6 commit a9228b9

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ WORKDIR /app
77
RUN cargo install cargo-chef
88
RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config
99

10-
LABEL org.opencontainers.image.source=https://github.com/lambdaclass/ethlambda
11-
LABEL org.opencontainers.image.description="ethlambda is a modular Ethereum beam chain client."
12-
LABEL org.opencontainers.image.licenses="MIT"
13-
1410
# Builds a cargo-chef plan
1511
FROM chef AS planner
1612
COPY --exclude=.git --exclude=target . .
@@ -46,6 +42,16 @@ RUN cp /app/target/$BUILD_PROFILE/ethlambda /app/ethlambda
4642
FROM ubuntu AS runtime
4743
WORKDIR /app
4844

45+
LABEL org.opencontainers.image.source=https://github.com/lambdaclass/ethlambda
46+
LABEL org.opencontainers.image.description="Minimalist, fast and modular implementation of the Lean Ethereum client written in Rust."
47+
LABEL org.opencontainers.image.licenses="MIT"
48+
49+
ARG GIT_COMMIT=unknown
50+
ARG GIT_BRANCH=unknown
51+
52+
LABEL org.opencontainers.image.revision=$GIT_COMMIT
53+
LABEL org.opencontainers.image.ref.name=$GIT_BRANCH
54+
4955
# Copy ethlambda over from the build stage
5056
COPY --from=builder /app/ethlambda /usr/local/bin
5157

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ test: ## 🧪 Run all tests, then forkchoice tests with skip-signature-verificat
1010
cargo test --workspace
1111
cargo test -p ethlambda-blockchain --features skip-signature-verification --test forkchoice_spectests
1212

13+
GIT_COMMIT=$(shell git rev-parse HEAD)
14+
GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
15+
1316
docker-build: ## 🐳 Build the Docker image
14-
docker build -t ghcr.io/lambdaclass/ethlambda:local .
17+
docker build \
18+
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
19+
--build-arg GIT_BRANCH=$(GIT_BRANCH) \
20+
-t ghcr.io/lambdaclass/ethlambda:local .
1521

1622
LEAN_SPEC_COMMIT_HASH:=fbbacbea4545be870e25e3c00a90fc69e019c5bb
1723

0 commit comments

Comments
 (0)