Make the Docker image self-contained: build the binary inside the Dockerfile
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- docker, github-actions, rust
- Domain
- build-system, ci-cd, devops
Research direction
Start with Dockerfile and the binary build steps in .github/workflows/docker.yml, especially the referenced workflow and Dockerfile lines. Build the Rust binary in a separate builder stage, copy it into the runtime stage, and update the workflow to run docker buildx build without separate binary artifacts. Done means a clean checkout builds the image with docker build and the workflow still supports multi-architecture publishing.
Written by the indexing model from the issue text.
Description
What problem does your feature solve?
The stellar/stellar-cli Docker image cannot be built from a clean checkout with docker build alone. The stellar binary is built by the GitHub Actions workflow and then copied into the image at build time, so the Dockerfile is not self-contained.
The binary build steps live in .github/workflows/docker.yml:
The Dockerfile then expects the pre-built binary to already be present in the build context:
This makes it difficult to test changes to the Dockerfile and the resulting image locally. To build the image a developer has to:
- Read the GitHub workflow.
- Replicate the binary build steps in an Ubuntu environment matching the workflow.
- Place the resulting binary at
stellar-${TARGETARCH}/stellarin the build context. - Run
docker build.
That is fragile and error-prone, and any change to the build process has to be kept in sync across the workflow and the Dockerfile.
What would you like to see?
Move the binary build into the Dockerfile itself as a separate builder stage so the image is self-contained:
- A
builderstage based onrust:latestthat installs build dependencies (libudev-dev,libdbus-1-dev) and runscargo build --package stellar-cli --release. - A final runtime stage that uses
COPY --from=builderto pull the resultingstellarbinary into place.
The GitHub workflow would then just run docker buildx build (multi-arch) and push, with no separate "build binary" job and no artifact upload/download dance.
Benefits:
- Anyone can build and test the image locally with a single
docker buildfrom a clean checkout, no workflow knowledge required. - The
Dockerfilebecomes the single source of truth for how the image is built. - No drift between the workflow's build steps and the
Dockerfile's expectations.
- Dominant language
- Rust
- Stars
- 123
- Forks
- 141
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stellar/stellar-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stellar/stellar-cli#2384 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stellar/stellar-cli#2347 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
stellar/stellar-cli#2723 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
stellar/stellar-cli#2722 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
stellar/stellar-cli#2703 ·
All issues in stellar/stellar-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100