Skip to content

ci: Add multi-arch docker build with dual-registry push - #1139

Open
johnnyasantoss wants to merge 1 commit into
getfloresta:masterfrom
johnnyasantoss:feat/multi-arch-docker
Open

johnnyasantoss wants to merge 1 commit into
getfloresta:masterfrom
johnnyasantoss:feat/multi-arch-docker

Conversation

@johnnyasantoss

Copy link
Copy Markdown
Contributor

Description and Notes

Adds a matrix build for linux/amd64, linux/arm64, and linux/arm/v7 (most common
linux server archs) to the Docker workflow.
Per-arch images are pushed to both GHCR and DockerHub, then merged into multi-arch manifests with proper
version and branch tags. Supports manual workflow_dispatch to rebuild and
publish images for previous tags.

The merge logic is externalized into shell scripts under .github/workflows/docker/ for maintainability. The manifest creation uses
a self-contained 5-step process (merge to GHCR, copy to Docker Hub, cleanup
temp tags, copy back, tag versions) to avoid dangling references from deleted
per-arch temp tags. A catch-all cleanup step runs regardless of success/failure.

Also adds OCI labels to the Dockerfile following best practices.

Related to #588

How to verify the changes you have done?

See my fork. https://github.com/johnnyasantoss/floresta/actions/runs/27847196957

Contributor Checklist

  • I've followed the contribution guidelines
  • I've verified one of the following:
    • Ran just pcc (recommended but slower)
    • Ran just lint-features '-- -D warnings' && cargo test --release
    • Confirmed CI passed on my fork
  • I've linked any related issue(s) in the sections above

Finally, you are encouraged to sign all your commits (it proves authorship and guards against tampering—see How (and why) to sign Git commits and GitHub's guide to signing commits).

@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

You can also test with docker run --rm johnnyasantoss/floresta (should run in amd64/arm64/aarch64 - I've tested all)

@moisesPompilio moisesPompilio added the CI Issues and PRs related to GitHub Actions, automated checks and CI reliability. label Jun 22, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Floresta Jun 22, 2026
@moisesPompilio moisesPompilio moved this from Backlog to Needs review in Floresta Jun 22, 2026
@johnnyasantoss
johnnyasantoss force-pushed the feat/multi-arch-docker branch from a304574 to b6c1440 Compare June 27, 2026 19:42
@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

Rebased. Prev ci failure was not related to this branch

@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

I've ran the clippy command locally and it's working. CI doesn't seem to be working or related to this.

@luisschwab

Copy link
Copy Markdown
Member

@johnnyasantoss can you rebase? The clippy error should be fixed now.

@johnnyasantoss
johnnyasantoss force-pushed the feat/multi-arch-docker branch from b6c1440 to 50928ef Compare July 1, 2026 14:21
@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

Rebased

@csgui csgui added this to the Q3/2026 milestone Jul 9, 2026
@Micah-Shallom

Copy link
Copy Markdown
Contributor

needs rebase

@johnnyasantoss
johnnyasantoss force-pushed the feat/multi-arch-docker branch from 50928ef to 49f4ee8 Compare August 3, 2026 23:04
@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

needs rebase

Done. Rebased.

@Davidson-Souza

Copy link
Copy Markdown
Member

@johnnyasantoss can you also add the readme to the container metadata?

@johnnyasantoss
johnnyasantoss force-pushed the feat/multi-arch-docker branch from 49f4ee8 to fb905e3 Compare August 7, 2026 14:49
@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

can you also add the readme to the container metadata?

yes and no. I wish it was so simple. See:

I pushed a change linking to this repo's readme (which is the one I believe you are referring to)

49f4ee8..fb905e3

@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

I can add something like this if you want: https://github.com/peter-evans/dockerhub-description
forgot to mention @Davidson-Souza

@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

Rebased

@johnnyasantoss
johnnyasantoss force-pushed the feat/multi-arch-docker branch 2 times, most recently from fb2b191 to 9d51fcf Compare September 5, 2026 18:33
@Davidson-Souza

Copy link
Copy Markdown
Member

Vibe-review for the changes, feel free to dismiss what's not relevant

1. P1 — Manual dispatch builds the workflow revision, not inputs.ref
    .github/workflows/docker.yml:43-58, .github/workflows/docker.yml:114-119
    Checkout uses the requested ref, but both docker/build-push-action steps omit context: .. The action therefore uses its default event-derived Git context, ignoring the checked-out tree. A manual run can publish the workflow/default-branch source under a tag intended for a     
    different commit, branch, or release tag.
 2. P1 — Concurrent branch and tag pushes race on temporary GHCR tags
    .github/workflows/docker.yml:24, .github/workflows/docker.yml:114-119, .github/workflows/docker.yml:185-193
    A master push and a v* tag push for the same commit both use sha-${github.sha} and publish identical per-architecture temporary tags. Either merge job can clean them up before the other job creates its manifest, causing the other run—commonly the release-tag run—to fail       
    without publishing the version tag or latest.
 3. P1 — Generated GHCR references contain an invalid uppercase repository component
    .github/workflows/docker.yml:22, .github/workflows/docker/create-manifests.sh:5, .github/workflows/docker/determine-tags.sh:5
    This repository is getfloresta/Floresta; interpolating GITHUB_REPOSITORY produces ghcr.io/getfloresta/Floresta:<tag>. Docker repository names must be lowercase, so Buildx rejects these references. This blocks both the initial image build—which includes GHCR_IMAGE as a tag—and 
    manifest publication. Normalize the image repository name once and use that normalized value everywhere.
 4. P2 — Manual dispatch cannot build historical refs predating these helper scripts
    .github/workflows/docker.yml:138-174
    The merge job checks out the user-supplied ref, then executes helper scripts introduced by this PR. Selecting an older tag, branch, or commit without .github/workflows/docker/*.sh fails at determine-tags.sh before publication. The documented dispatch input explicitly allows   
    arbitrary tags, branches, and SHAs.

I can add something like this if you want: https://github.com/peter-evans/dockerhub-description

My comment was about the text shown here, currently it says No overview available

@csgui csgui added the docker Issues related to Docker images, containers and containerized development or deployment label Sep 15, 2026
@csgui

csgui commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

I have validated the image pull on a ARM64 and it is working.

@johnnyasantoss can you please check Davidson's findings? Tks!

@Davidson-Souza maybe, initially, we can publish the images only on GitHub. It was nice to see them published there, like in Johnny's fork https://github.com/johnnyasantoss/floresta/pkgs/container/floresta

@Davidson-Souza

Copy link
Copy Markdown
Member

@Davidson-Souza maybe, initially, we can publish the images only on GitHub.

I have no problem on using ghcr-only for now. The priority here is the multi-arch setup since that will be useful for BtcPay and some node-in-a-box that are Docker-based.

@csgui

csgui commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Ok. That BTCPay requirement slipped past me. So, better take the opportunity and work on the complete solution.

@csgui csgui removed this from the Q3/2026 milestone Oct 1, 2026
@csgui csgui added this to the Q4/2026 milestone Oct 1, 2026
@johnnyasantoss

Copy link
Copy Markdown
Contributor Author

Vibe-review for the changes, feel free to dismiss what's not relevant

All addressed. Sorry for the delay. I don't think 2 & 3 were ever going to happen but it's fixed anyway.

My comment was about the text shown here, currently it says No overview available

Yes, that's what that tool does. DockerHub does NOT auto generate that based on readme or any other file. It has its own way of creating the overview.

Rebased too.

CC @Davidson-Souza @csgui

@csgui csgui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK 5f48704

Adds a matrix build for linux/amd64, linux/arm64, and linux/arm/v7 (most
common
linux server archs) to the Docker workflow.
Per-arch images are pushed to both GHCR and DockerHub,
then merged into multi-arch manifests with proper
version and branch tags. Supports manual workflow_dispatch to rebuild
and
publish images for previous tags.

The merge logic is externalized into shell scripts under
.github/workflows/docker/ for maintainability. The manifest creation
uses
a self-contained 5-step process (merge to GHCR, copy to Docker Hub,
cleanup
temp tags, copy back, tag versions) to avoid dangling references from
deleted
per-arch temp tags. A catch-all cleanup step runs regardless of
success/failure.

Also adds OCI labels to the Dockerfile following best practices.

Assisted-by: GLM 5.2
@johnnyasantoss

johnnyasantoss commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Issues and PRs related to GitHub Actions, automated checks and CI reliability. docker Issues related to Docker images, containers and containerized development or deployment

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

6 participants