From b1ea429435851f8b1117f87687acf7a44d4e743d Mon Sep 17 00:00:00 2001 From: Mirko von Leipzig <48352201+Mirko-von-Leipzig@users.noreply.github.com> Date: Fri, 5 Jun 2026 14:09:35 +0200 Subject: [PATCH 1/3] Update docker image and multi-arch support --- .github/workflows/build-docker.yml | 20 ++++++++-- .github/workflows/publish-docker.yml | 19 ++++++++-- Dockerfile | 10 +++-- Makefile | 38 +++++++++++-------- .../external/src/local-network-development.md | 3 ++ .../src/network-operator/installation.md | 2 + 6 files changed, 66 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index f0b846c35..85e29d309 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -10,6 +10,9 @@ permissions: contents: read id-token: write +env: + DOCKER_PLATFORMS: linux/amd64,linux/arm64 + jobs: docker-build: runs-on: warp-ubuntu-latest-x64-8x @@ -34,18 +37,29 @@ jobs: name: Build ${{ matrix.component }} steps: - name: Checkout repo - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + - name: Prepare image metadata + id: metadata + run: | + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + echo "version=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + - name: Build - uses: WarpBuilds/build-push-action@8c1f3b8bd22c68607865d99ff650d37a564229a5 # v6.0.7 + uses: WarpBuilds/build-push-action@ec038a9f4b87a7c7ccb50ac7a26a90d46a610a81 # v6.0.9 with: context: . push: false file: ./Dockerfile - platforms: linux/amd64 + platforms: ${{ env.DOCKER_PLATFORMS }} profile-name: ${{ vars.WARPBUILD_DOCKER_BUILDER_PROFILE }} + pull: true build-args: | BIN=${{ matrix.bin }} PORT=${{ matrix.port }} + CREATED=${{ steps.metadata.outputs.created }} + VERSION=${{ steps.metadata.outputs.version }} + COMMIT=${{ steps.metadata.outputs.commit }} diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index ebc0ce21f..b01434109 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -14,6 +14,7 @@ on: env: version: ${{ inputs.version || github.ref_name }} registry: ghcr.io + DOCKER_PLATFORMS: linux/amd64,linux/arm64 permissions: id-token: write @@ -46,14 +47,20 @@ jobs: name: Publish ${{ matrix.component }} ${{ inputs.version }} steps: - name: Checkout repo - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ env.version }} fetch-depth: 0 persist-credentials: false + - name: Prepare image metadata + id: metadata + run: | + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: registry: ${{ env.registry }} username: ${{ github.actor }} @@ -61,14 +68,18 @@ jobs: - name: Build and push Docker image id: push - uses: WarpBuilds/build-push-action@8c1f3b8bd22c68607865d99ff650d37a564229a5 # v6.0.7 + uses: WarpBuilds/build-push-action@ec038a9f4b87a7c7ccb50ac7a26a90d46a610a81 # v6.0.9 with: context: . push: true file: ./Dockerfile - platforms: linux/amd64 + platforms: ${{ env.DOCKER_PLATFORMS }} profile-name: ${{ vars.WARPBUILD_DOCKER_BUILDER_PROFILE }} + pull: true build-args: | BIN=${{ matrix.bin }} PORT=${{ matrix.port }} + CREATED=${{ steps.metadata.outputs.created }} + VERSION=${{ env.version }} + COMMIT=${{ steps.metadata.outputs.commit }} tags: ${{ env.registry }}/0xmiden/miden-${{ matrix.component }}:${{ env.version }} diff --git a/Dockerfile b/Dockerfile index 6c3da4b7f..61e46b944 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ # syntax=docker/dockerfile:1 +ARG RUST_VERSION=1.93 +ARG DEBIAN_RELEASE=trixie ARG BIN ARG PORT -FROM rust:1.93-slim-bookworm AS chef +FROM rust:${RUST_VERSION}-slim-${DEBIAN_RELEASE} AS chef # Install build dependencies. RocksDB is compiled from source by librocksdb-sys. RUN apt-get update && \ apt-get -y upgrade && \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ llvm \ clang \ libclang-dev \ @@ -44,8 +46,8 @@ RUN --mount=type=cache,sharing=locked,target=/usr/local/cargo/registry \ mkdir -p /app/bin && \ cp /app/target/release/${BIN} /app/bin/${BIN} -# Base line runtime image with runtime dependencies installed. -FROM debian:bookworm-slim AS runtime-base +# Baseline runtime image with runtime dependencies installed. +FROM debian:${DEBIAN_RELEASE}-slim AS runtime-base RUN apt-get update && \ apt-get -y upgrade && \ apt-get install -y --no-install-recommends sqlite3 ca-certificates \ diff --git a/Makefile b/Makefile index 941d19924..d4a2702b8 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ help: WARNINGS=RUSTDOCFLAGS="-D warnings" STRESS_TEST_DATA_DIR ?= stress-test-store-$(shell date +%Y%m%d-%H%M%S) COMPOSE_FILES = -f docker-compose.yml -f compose/telemetry.yml -f compose/monitor.yml +DOCKER_PLATFORM ?= +DOCKER_PLATFORM_ARG = $(if $(DOCKER_PLATFORM),--platform $(DOCKER_PLATFORM),) +DOCKER_VERSION ?= $(shell awk -F '"' '/^version[[:space:]]*=/ { print $$2; exit }' Cargo.toml) CONFIG_DIR = .config README_FILES = $(shell git ls-files '*README.md') EXTERNAL_DOCS_MARKDOWN_FILES = $(shell git ls-files 'docs/external/**/*.md') @@ -194,10 +197,11 @@ docker-build: docker-build-node docker-build-validator docker-build-ntx-builder .PHONY: docker-build-node docker-build-node: ## Builds the Miden node using Docker - @CREATED=$$(date) && \ - VERSION=$$(cat bin/node/Cargo.toml | grep -m 1 '^version' | cut -d '"' -f 2) && \ + @CREATED=$$(date -u +'%Y-%m-%dT%H:%M:%SZ') && \ + VERSION="$(DOCKER_VERSION)" && \ COMMIT=$$(git rev-parse HEAD) && \ - docker build --build-arg CREATED="$$CREATED" \ + docker build --pull $(DOCKER_PLATFORM_ARG) \ + --build-arg CREATED="$$CREATED" \ --build-arg VERSION="$$VERSION" \ --build-arg COMMIT="$$COMMIT" \ --build-arg BIN=miden-node \ @@ -206,10 +210,11 @@ docker-build-node: ## Builds the Miden node using Docker .PHONY: docker-build-validator docker-build-validator: ## Builds the Miden validator using Docker - @CREATED=$$(date) && \ - VERSION=$$(cat bin/validator/Cargo.toml | grep -m 1 '^version' | cut -d '"' -f 2) && \ + @CREATED=$$(date -u +'%Y-%m-%dT%H:%M:%SZ') && \ + VERSION="$(DOCKER_VERSION)" && \ COMMIT=$$(git rev-parse HEAD) && \ - docker build --build-arg CREATED="$$CREATED" \ + docker build --pull $(DOCKER_PLATFORM_ARG) \ + --build-arg CREATED="$$CREATED" \ --build-arg VERSION="$$VERSION" \ --build-arg COMMIT="$$COMMIT" \ --build-arg BIN=miden-validator \ @@ -218,10 +223,11 @@ docker-build-validator: ## Builds the Miden validator using Docker .PHONY: docker-build-ntx-builder docker-build-ntx-builder: ## Builds the Miden network transaction builder using Docker - @CREATED=$$(date) && \ - VERSION=$$(cat bin/ntx-builder/Cargo.toml | grep -m 1 '^version' | cut -d '"' -f 2) && \ + @CREATED=$$(date -u +'%Y-%m-%dT%H:%M:%SZ') && \ + VERSION="$(DOCKER_VERSION)" && \ COMMIT=$$(git rev-parse HEAD) && \ - docker build --build-arg CREATED="$$CREATED" \ + docker build --pull $(DOCKER_PLATFORM_ARG) \ + --build-arg CREATED="$$CREATED" \ --build-arg VERSION="$$VERSION" \ --build-arg COMMIT="$$COMMIT" \ --build-arg BIN=miden-ntx-builder \ @@ -230,10 +236,11 @@ docker-build-ntx-builder: ## Builds the Miden network transaction builder using .PHONY: docker-build-monitor docker-build-monitor: ## Builds the network monitor using Docker - @CREATED=$$(date) && \ - VERSION=$$(cat bin/network-monitor/Cargo.toml | grep -m 1 '^version' | cut -d '"' -f 2) && \ + @CREATED=$$(date -u +'%Y-%m-%dT%H:%M:%SZ') && \ + VERSION="$(DOCKER_VERSION)" && \ COMMIT=$$(git rev-parse HEAD) && \ - docker build --build-arg CREATED="$$CREATED" \ + docker build --pull $(DOCKER_PLATFORM_ARG) \ + --build-arg CREATED="$$CREATED" \ --build-arg VERSION="$$VERSION" \ --build-arg COMMIT="$$COMMIT" \ --build-arg BIN=miden-network-monitor \ @@ -242,10 +249,11 @@ docker-build-monitor: ## Builds the network monitor using Docker .PHONY: docker-build-remote-prover docker-build-remote-prover: ## Builds the remote prover using Docker - @CREATED=$$(date) && \ - VERSION=$$(cat bin/remote-prover/Cargo.toml | grep -m 1 '^version' | cut -d '"' -f 2) && \ + @CREATED=$$(date -u +'%Y-%m-%dT%H:%M:%SZ') && \ + VERSION="$(DOCKER_VERSION)" && \ COMMIT=$$(git rev-parse HEAD) && \ - docker build --build-arg CREATED="$$CREATED" \ + docker build --pull $(DOCKER_PLATFORM_ARG) \ + --build-arg CREATED="$$CREATED" \ --build-arg VERSION="$$VERSION" \ --build-arg COMMIT="$$COMMIT" \ --build-arg BIN=miden-remote-prover \ diff --git a/docs/external/src/local-network-development.md b/docs/external/src/local-network-development.md index 43f87e20d..6ed52abbf 100644 --- a/docs/external/src/local-network-development.md +++ b/docs/external/src/local-network-development.md @@ -42,6 +42,9 @@ Build the images after checkout or whenever you need fresh local images. The loc # Build the Docker images used by the local network. make local-network-build +# Optionally build for a specific Docker platform. +make local-network-build DOCKER_PLATFORM=linux/arm64 + # Start the local network. make local-network-up diff --git a/docs/external/src/network-operator/installation.md b/docs/external/src/network-operator/installation.md index 260427800..1738bdf05 100644 --- a/docs/external/src/network-operator/installation.md +++ b/docs/external/src/network-operator/installation.md @@ -67,4 +67,6 @@ You can also build images locally from a repository checkout: make docker-build ``` +Use `DOCKER_PLATFORM=linux/amd64` or `DOCKER_PLATFORM=linux/arm64` to build a specific local image platform. + From 7498651fe1b9e3ddffcbdf08c6ffae438cafa15b Mon Sep 17 00:00:00 2001 From: Mirko von Leipzig <48352201+Mirko-von-Leipzig@users.noreply.github.com> Date: Fri, 5 Jun 2026 14:23:38 +0200 Subject: [PATCH 2/3] Revert trixie upgrade --- CHANGELOG.md | 1 + Dockerfile | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4376a7015..29ac5a03e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Fixed trace exports not supporting TLS ([#2199](#https://github.com/0xMiden/node/pull/2199)). - Updated to protocol v0.15.2 (v0.15.0 and v0.15.1 are yanked) ([#2205](#https://github.com/0xMiden/node/pull/2205)). - Ensure that the proposed block's validator key matches our own before signing [#2203](https://github.com/0xMiden/node/pull/2203). +- Added `arm64/linux` support to Docker images ((#2209)[https://github.com/0xMiden/node/pull/2209]). ## v0.15.0-rc.0 (2026-06-03) diff --git a/Dockerfile b/Dockerfile index 61e46b944..6f04333d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 ARG RUST_VERSION=1.93 -ARG DEBIAN_RELEASE=trixie +ARG DEBIAN_RELEASE=bookworm ARG BIN ARG PORT @@ -16,7 +16,6 @@ RUN apt-get update && \ cmake \ pkg-config \ libssl-dev \ - libsqlite3-dev \ ca-certificates && \ rm -rf /var/lib/apt/lists/* RUN cargo install cargo-chef @@ -50,7 +49,6 @@ RUN --mount=type=cache,sharing=locked,target=/usr/local/cargo/registry \ FROM debian:${DEBIAN_RELEASE}-slim AS runtime-base RUN apt-get update && \ apt-get -y upgrade && \ - apt-get install -y --no-install-recommends sqlite3 ca-certificates \ && rm -rf /var/lib/apt/lists/* FROM runtime-base AS runtime From ec4a740c76677341e120f5626834f1cf74c131c0 Mon Sep 17 00:00:00 2001 From: Mirko von Leipzig <48352201+Mirko-von-Leipzig@users.noreply.github.com> Date: Sat, 6 Jun 2026 07:26:21 +0200 Subject: [PATCH 3/3] Fix duplicate && --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6f04333d8..5059c4bc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,7 @@ RUN --mount=type=cache,sharing=locked,target=/usr/local/cargo/registry \ FROM debian:${DEBIAN_RELEASE}-slim AS runtime-base RUN apt-get update && \ apt-get -y upgrade && \ - && rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* FROM runtime-base AS runtime ARG BIN