Repository navigation
ci: publish the Docker image to Docker Hub on release - #1677
Conversation
Builds deploy/Dockerfile at the release tag for linux/amd64 and linux/arm64 and pushes ghumarerohit/agentmemory with the version tag, plus latest for stable releases. A linux/amd64 build is started first and must answer /agentmemory/livez before anything is pushed. Images carry OCI labels, provenance and an SBOM. workflow_dispatch back-fills a given version. deploy/README.md documents the prebuilt image.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedFailed to post review comments. GitHub was unavailable or timed out while CodeRabbit was posting the review. Please request a new review later if the pull request still needs one. This happened while posting 1 inline comment. Use
|
| Layer / File(s) | Summary |
|---|---|
Validate, build, and smoke-test .github/workflows/docker-image.yml |
The workflow accepts published releases or manual version input, validates the version, checks out the matching tag, smoke-tests an amd64 image, and uploads an amd64/arm64 OCI archive. |
Publish and attest the versioned image .github/workflows/docker-image.yml |
The workflow pushes the versioned image to Docker Hub, checks that both platforms are present, and attests the pushed digest. |
Update latest and document deployment .github/workflows/docker-image.yml, deploy/README.md |
The workflow points latest to the greatest stable release when that image is available. The README documents image startup, loopback-bound ports, persistent /data contents, environment-variable configuration, and first-start network requirements. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant ReleaseOrManualDispatch
participant GitHubActions
participant DockerHub
ReleaseOrManualDispatch->>GitHubActions: Provide release or version
GitHubActions->>GitHubActions: Validate version and build image
GitHubActions->>GitHubActions: Smoke-test amd64 and create amd64/arm64 archive
GitHubActions->>DockerHub: Publish versioned image and attest digest
GitHubActions->>DockerHub: Copy greatest stable image to latest when available
Possibly related PRs
- rohitg00/agentmemory#1634: Changes pinned worker versions in the Dockerfile used to build the published image.
- rohitg00/agentmemory#1592: Introduces the Dockerfile and deployment runtime used by this workflow.
- rohitg00/agentmemory#1651: Changes Dockerfile dependencies and validates the image built by this workflow.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "ci: publish the Docker image to Docker Hub on release" matches the main change. The PR adds .github/workflows/docker-image.yml, which publishes the image to Docker Hub when a GitHub release is published. The deploy/README.md update documents the pull commands for that image. The title is specific, short, and does not describe anything absent from the changeset.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
…e job - build runs the release tag code with no secrets or registry login and hands an OCI archive to publish as an artifact. - publish runs in the docker-hub environment without checking out the repository, pushes with skopeo, verifies both platforms and attests build provenance for the pushed digest. - latest is a serialized job that points latest at the release GitHub marks as Latest, so an older or delayed release cannot replace it.
The latest job now takes the highest stable release version from all non-draft, non-prerelease releases instead of the release GitHub marks as Latest, which a backport published later would become.
- Check out the release tag exactly as published; only a manual run maps the version to v<version>. - Reject versions longer than the 128-character Docker tag limit. - Keep the image artifact for 14 days so a slow environment approval does not expire it. - Treat no stable release as a clean no-op under pipefail.
Adds the CHANGELOG lines for #1599 and #1677, which merged after the 0.9.32 section was written. Updates the gist badge to 1.7k stars and 240 forks in the README and every translation, drops the Copilot setup note that still waits for the 0.9.30 release, and regenerates the website metadata for 0.9.32.
Summary
Publishes a prebuilt agentmemory image to Docker Hub as
ghumarerohit/agentmemorywhenever a GitHub release is published. npm publishing is unchanged and stays local;publish.ymlis not touched.What the workflow does
.github/workflows/docker-image.ymlhas three jobs.build(permissionscontents: read, no secrets, no registry login):workflow_dispatchversioninput for back-fills (at most 128 characters, the Docker tag limit). Checks out the release tag exactly as published, orv<version>for a manual run.linux/amd64withload: true, starts the container, and waits up to 180 s forGET /agentmemory/livezon port 3111. On failure it prints the container logs and stops the run.linux/amd64andlinux/arm64fromdeploy/Dockerfileinto an OCI archive with OCI labels (source, revision, version, licenses Apache-2.0), and uploads it as an artifact kept for 14 days, so a slow environment approval does not expire it.publish(environmentdocker-hub; no checkout, no repository code):ghumarerohit/agentmemory:<version>withskopeo copy --all --preserve-digests.linux/amd64andlinux/arm64.actions/attest-build-provenanceand pushes the attestation to the registry. This job alone getsid-token: writeandattestations: write.latest(environmentdocker-hub; concurrency groupdocker-hub-latest, no cancellation):latestat the image of the highest stable release version, picked in semver order from all non-draft, non-prerelease GitHub releases right before the push. If that version's image is not pushed yet, it leaveslatestunchanged. An older release, a backport published later, a prerelease, or a manual back-fill can never movelatestbackwards, and whichever run finishes last converges on the newest stable release.deploy/README.mdgets a short "Prebuilt image" section: pull and run commands, the/datavolume, ports 3111 and 3113 bound to loopback, the multi-arch note, and thelatestrule.Security
build, which has no secrets, no registry login, and a read-only token. The Docker Hub token never reaches a job that has executed repository code.publishandlatestdo not check out the repository. They only handle the image archive, the registry, and the GitHub releases API.docker-hubenvironment. Add a required reviewer to that environment (Settings > Environments > docker-hub) to approve every push, and you can storeDOCKERHUB_USERNAMEandDOCKERHUB_TOKENthere as environment secrets instead of repository secrets.actions/attest-build-provenanceagainst the pushed digest instead. No SBOM is attached in this version.Before the first run
ghumarerohit/agentmemoryrepository already exists on Docker Hub (public, empty).docker-hubenvironment:DOCKERHUB_USERNAME: a ghumarerohit org member or bot user that can push to the repositoryDOCKERHUB_TOKEN: a Docker Hub access token with write scope onghumarerohit/agentmemoryBack-filling 0.9.32
If 0.9.32 is released before this merges, run Actions > Docker image > Run workflow with
versionset to0.9.32. Thelatestjob then pointslatestat 0.9.32 if it is the highest stable release.Notes
actionlintpasses on the workflow.Summary by CodeRabbit
New Features
latestimage tag tracks the highest stable release version when its image is available; otherwise, it remains unchanged.Documentation