Skip to content

Make the Docker rust base image configurable.#2568

Open
fnando wants to merge 7 commits intomainfrom
docker-custom-image
Open

Make the Docker rust base image configurable.#2568
fnando wants to merge 7 commits intomainfrom
docker-custom-image

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented May 7, 2026

What

Make the Docker image self-contained and customizable. Closes #2542.

The Dockerfile is now multi-stage: the builder stage clones the requested CLI source from GitHub and runs cargo build against the target rust base image. Both stages use the same rust:${RUST_IMAGE} image, so glibc and shared libraries cannot drift between build and runtime.

Two knobs are exposed to the workflow:

  • rust_image (default latest) — pins the rust base image used for both stages. When non-default, images are tagged with a -rust-<sanitized> suffix and :latest is not updated.
  • ref flows into the Dockerfile as CLI_REF and selects which version of stellar-cli to clone and build.

Anyone can now reproduce a target configuration with a single command, no workflow knowledge required:

docker build \
  --build-arg RUST_IMAGE=1.90.0-slim-bookworm \
  --build-arg CLI_REF=v25.1.0 \
  -t stellar-cli:25.1.0-rust-1.90.0-slim-bookworm .

Multi-arch builds run on native runners (ubuntu-latest for amd64, ubuntu-24.04-arm for arm64) and push per-arch by digest; a final manifest job combines them into the tagged manifest list — no QEMU emulation in CI.

Why

https://stellarfoundation.slack.com/archives/C08AP4BN24E/p1778093609993929?thread_ts=1773364869.231219&cid=C08AP4BN24E

Known limitations

N/A

Copilot AI review requested due to automatic review settings May 7, 2026 19:23
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX May 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the Rust base image used by the Docker build configurable via a build argument, and wires that through the GitHub Actions Docker publishing workflow so callers can choose a specific Rust image tag.

Changes:

  • Parameterize Dockerfile’s FROM rust:... with a RUST_IMAGE build arg (defaulting to latest).
  • Add a workflow_dispatch input to select the Rust image tag, and pass it as a Docker build arg.
  • Adjust Docker tag computation so non-default Rust images get a -rust-<image> suffix and do not update the :latest tag on version releases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Dockerfile Adds ARG RUST_IMAGE and uses it in the FROM line to make the Rust base image tag configurable.
.github/workflows/docker.yml Adds a workflow input + env propagation for RUST_IMAGE, modifies tag computation to suffix tags when a custom Rust image is used, and passes the build arg to Buildx.

Comment thread .github/workflows/docker.yml
@fnando fnando force-pushed the docker-custom-image branch from d720221 to 8a53140 Compare May 7, 2026 22:17
@fnando fnando self-assigned this May 7, 2026
@fnando fnando moved this from Backlog (Not Ready) to In Progress in DevX May 7, 2026
@fnando fnando force-pushed the docker-custom-image branch from 8a53140 to a1cd5b6 Compare May 7, 2026 22:33
@fnando fnando force-pushed the docker-custom-image branch from a1cd5b6 to 7f37b6f Compare May 7, 2026 23:21
@fnando fnando moved this from In Progress to Needs Review in DevX May 7, 2026
@fnando fnando requested review from leighmcculloch and mootz12 May 7, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

Make the Docker image self-contained: build the binary inside the Dockerfile

2 participants