diff --git a/.dockerignore b/.dockerignore index d2666de..76e3aa1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,3 +7,4 @@ !bin/ !crates/ !LICENSE +!.git/ diff --git a/Dockerfile b/Dockerfile index 7cc43ec..d2344af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,8 @@ ENV FEATURES=$FEATURES RUN cargo chef cook --profile $BUILD_PROFILE --features "$FEATURES" --recipe-path recipe.json # Build application -COPY --exclude=.git --exclude=target . . +# Include .git so vergen-git2 can extract version info (branch, commit SHA) +COPY --exclude=target . . RUN cargo build --profile $BUILD_PROFILE --features "$FEATURES" --locked --bin ethlambda # ARG is not resolved in COPY so we have to hack around it by copying the diff --git a/Makefile b/Makefile index 1dbd445..e28ce6d 100644 --- a/Makefile +++ b/Makefile @@ -13,12 +13,13 @@ test: leanSpec/fixtures ## 🧪 Run all tests, then forkchoice tests with skip-s GIT_COMMIT=$(shell git rev-parse HEAD) GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) +DOCKER_TAG?=local docker-build: ## 🐳 Build the Docker image docker build \ --build-arg GIT_COMMIT=$(GIT_COMMIT) \ --build-arg GIT_BRANCH=$(GIT_BRANCH) \ - -t ghcr.io/lambdaclass/ethlambda:local . + -t ghcr.io/lambdaclass/ethlambda:$(DOCKER_TAG) . LEAN_SPEC_COMMIT_HASH:=4edcf7bc9271e6a70ded8aff17710d68beac4266 diff --git a/bin/ethlambda/src/main.rs b/bin/ethlambda/src/main.rs index c4fa991..aa438dc 100644 --- a/bin/ethlambda/src/main.rs +++ b/bin/ethlambda/src/main.rs @@ -68,6 +68,8 @@ async fn main() { println!("{ASCII_ART}"); + info!(version = version::CLIENT_VERSION, "Starting ethlambda"); + info!(node_key=?options.node_key, "got node key"); let genesis_path = options.custom_network_config_dir.join("genesis.json");