Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- devnet-*
workflow_dispatch:
inputs:
ref:
Expand Down Expand Up @@ -36,5 +37,8 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build & push docker images
env:
DOCKER_TAG: ${{ (github.ref_name == 'main' && 'unstable') || github.ref_name }}
run: |
make docker
make docker \
DOCKER_TAG=${{ env.DOCKER_TAG }}
2 changes: 2 additions & 0 deletions lean_client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ FROM ubuntu:22.04

ARG COMMIT_SHA
ARG BUILD_DATE
ARG GIT_BRANCH

LABEL org.opencontainers.image.title="grandine"
LABEL org.opencontainers.image.description="High performance Ethereum lean client"
LABEL org.opencontainers.image.authors="Grandine <info@grandine.io>"
LABEL org.opencontainers.image.source=https://github.com/grandinetech/lean
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.revision=$COMMIT_SHA
LABEL org.opencontainers.image.ref.name=$GIT_BRANCH
LABEL org.opencontainers.image.created=$BUILD_DATE

ARG TARGETARCH
Expand Down
8 changes: 5 additions & 3 deletions lean_client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ DOCKER_TAG ?= unstable
# Git commit hash of current source version. Used to include metadata into
# docker image.
COMMIT_SHA := $(shell git rev-parse HEAD)
# Git branch name, which was used to build current binary. Used to include
# metadata into docker image.
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
# Build date. Used for docker image metadata.
BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')

Expand Down Expand Up @@ -73,21 +76,20 @@ docker: ./target/x86_64-unknown-linux-gnu/release/lean_client ./target/aarch64-u
--platform linux/amd64,linux/arm64 \
--build-arg COMMIT_SHA=$(COMMIT_SHA) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
--build-arg GIT_BRANCH=$(GIT_BRANCH) \
--tag $(DOCKER_REPO):$(DOCKER_TAG) \
--push \
.

.PHONY: docker-local
# docker-local: ./target/x86_64-unknown-linux-gnu/release/lean_client ./target/aarch64-unknown-linux-gnu/release/lean_client
docker-local: ./target/x86_64-unknown-linux-gnu/release/lean_client
@mkdir -p ./bin/amd64
@cp ./target/x86_64-unknown-linux-gnu/release/lean_client ./bin/amd64/lean_client
# @mkdir -p ./bin/arm64
# @cp ./target/aarch64-unknown-linux-gnu/release/lean_client ./bin/arm64/lean_client
docker build \
--file Dockerfile \
--build-arg COMMIT_SHA=$(COMMIT_SHA) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
--build-arg GIT_BRANCH=$(GIT_BRANCH) \
--tag $(DOCKER_REPO):$(DOCKER_TAG) \
.

Expand Down
Loading