23 Commits

Author SHA1 Message Date
32c4f92aec Merge c32b837212 into 3f08b0a4e6 2025-09-05 10:01:02 +08:00
c32b837212 . 2025-08-31 11:22:03 +08:00
0a4a0026db . 2025-08-31 11:20:00 +08:00
66dd70d258 . 2025-08-31 11:14:16 +08:00
4615ba53c4 . 2025-08-31 11:12:57 +08:00
0328b040f7 . 2025-08-31 11:08:53 +08:00
f05e6b6f6e . 2025-08-31 11:05:59 +08:00
ca650a09e7 . 2025-08-31 11:02:14 +08:00
88bdda8c9a . 2025-08-31 10:55:21 +08:00
6212b9dc9e . 2025-08-31 10:51:37 +08:00
c23b12ac0c . 2025-08-31 10:50:01 +08:00
52b17dac1a . 2025-08-31 10:49:15 +08:00
cb4359ec20 . 2025-08-31 10:43:49 +08:00
9a9118ecd8 . 2025-08-31 10:37:56 +08:00
6e0cdfcbc1 . 2025-08-31 10:36:41 +08:00
68bc908adb . 2025-08-31 10:07:35 +08:00
b352197e20 . 2025-08-31 10:06:43 +08:00
c7ed9fc8f1 . 2025-08-31 10:02:39 +08:00
5bdde70351 . 2025-08-31 09:54:59 +08:00
d06e7ad7b0 . 2025-08-31 09:46:42 +08:00
166814b2be . 2025-08-31 09:41:17 +08:00
03f86c3a8d . 2025-08-31 09:34:59 +08:00
beb8f0b8c7 create docker release action 2025-08-31 09:31:31 +08:00
2 changed files with 89 additions and 0 deletions

37
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,37 @@
# Publishes the Docker image.
name: docker
on:
push:
tags:
- v*
env:
IMAGE_NAME: ${{ github.repository_owner }}/nanoreth
CARGO_TERM_COLOR: always
DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/nanoreth
DOCKER_USERNAME: ${{ github.actor }}
jobs:
build:
name: build and push as latest
runs-on: ubuntu-24.04
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v5
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Log in to Docker
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin
- name: Set up Docker builder
run: |
docker buildx create --use --name builder
- name: Build and push nanoreth image
run: make IMAGE_NAME=$IMAGE_NAME DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME PROFILE=maxperf docker-build-push-latest

View File

@ -1,6 +1,8 @@
# Modifed from reth Makefile # Modifed from reth Makefile
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
GIT_SHA ?= $(shell git rev-parse HEAD)
GIT_TAG ?= $(shell git describe --tags --abbrev=0 2>/dev/null)
BIN_DIR = "dist/bin" BIN_DIR = "dist/bin"
# List of features to use when building. Can be overridden via the environment. # List of features to use when building. Can be overridden via the environment.
@ -17,6 +19,9 @@ PROFILE ?= release
# Extra flags for Cargo # Extra flags for Cargo
CARGO_INSTALL_EXTRA_FLAGS ?= CARGO_INSTALL_EXTRA_FLAGS ?=
# The docker image name
DOCKER_IMAGE_NAME ?= ghcr.io/hl-archive-node/nanoreth
##@ Help ##@ Help
.PHONY: help .PHONY: help
@ -207,3 +212,50 @@ check-features:
--package reth-primitives-traits \ --package reth-primitives-traits \
--package reth-primitives \ --package reth-primitives \
--feature-powerset --feature-powerset
##@ Docker
# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder`
.PHONY: docker-build-push
docker-build-push: ## Build and push a cross-arch Docker image tagged with the latest git tag.
$(call docker_build_push,$(GIT_TAG),$(GIT_TAG))
# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder`
.PHONY: docker-build-push-git-sha
docker-build-push-git-sha: ## Build and push a cross-arch Docker image tagged with the latest git sha.
$(call docker_build_push,$(GIT_SHA),$(GIT_SHA))
# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder`
.PHONY: docker-build-push-latest
docker-build-push-latest: ## Build and push a cross-arch Docker image tagged with the latest git tag and `latest`.
$(call docker_build_push,$(GIT_TAG),latest)
# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --name cross-builder`
.PHONY: docker-build-push-nightly
docker-build-push-nightly: ## Build and push cross-arch Docker image tagged with the latest git tag with a `-nightly` suffix, and `latest-nightly`.
$(call docker_build_push,nightly,nightly)
# Create a Docker image using the main Dockerfile
define docker_build_push
docker buildx build --file ./Dockerfile . \
--platform linux/amd64 \
--tag $(DOCKER_IMAGE_NAME):$(1) \
--tag $(DOCKER_IMAGE_NAME):$(2) \
--build-arg BUILD_PROFILE="$(PROFILE)" \
--build-arg FEATURES="jemalloc,asm-keccak" \
--build-arg RUSTFLAGS="-C target-cpu=native" \
--provenance=false \
--push
endef