fix(docker): default to serve and move the database to /data - #133
Open
blueagledev wants to merge 1 commit into
Open
blueagledev wants to merge 1 commit into
blueagledev wants to merge 1 commit into
Conversation
`Commands` is a required subcommand, so the image had no runnable default: the README's own `docker run ... korrosync` exits 2 with a usage dump. `CMD ["serve"]` supplies one and still leaves `docker run ... korrosync db info` and friends working, since arguments replace CMD and not ENTRYPOINT. The database also defaulted to /db.redb, inside the writable container layer, where `docker rm` plus a recreate drops every user and reading position. The README already says to pass `-e KORROSYNC_DB_PATH=/data/db.redb`, so nobody following it was exposed; the trap was for anyone who did not, and that `-e` line existed only to compensate for the default. Making /data the default removes both, and matches the application default of `data/db.redb`. No VOLUME declaration: a plain `docker run` attaches a fresh anonymous volume, so it does not make the data survive a recreate, it leaves a dangling volume behind on every cycle, and a downstream image cannot undeclare it. The default path plus a README sentence is the whole fix. BREAKING CHANGE: the image no longer sets KORROSYNC_DB_PATH=/db.redb, it defaults to /data/db.redb. A deployment that relied on the old default comes back up against an empty database and answers 401 Invalid credentials, which is the same symptom this commit fixes. Copy the file across before recreating the container: docker cp korrosync:/db.redb ./data/db.redb Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the container UX defaults for Korrosync so the published Docker image runs successfully without requiring an explicit subcommand, and so the default database location aligns with a persistent mount point (/data) rather than the ephemeral container layer.
Changes:
- Add
CMD ["serve"]sodocker run korrosyncstarts the server by default while preserving subcommand behavior. - Change the image default
KORROSYNC_DB_PATHto/data/db.redb(from/db.redb) to encourage persistence via a bind mount. - Update README Docker run examples, add a subcommand example, and document the upgrade path for older images that used
/db.redb.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| README.md | Removes the redundant KORROSYNC_DB_PATH env var from run examples, adds subcommand usage example, and documents upgrade guidance for the old /db.redb default. |
| Dockerfile | Sets safer default DB path (/data/db.redb) and adds CMD ["serve"] so the image has a runnable default command. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
blueagledev
force-pushed
the
fix/docker-serve-cmd-and-data-path
branch
from
August 30, 2026 09:51
07ee28a to
ac45b9b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two Dockerfile fixes plus the README lines that go with them. Found while evaluating
korrosync as the sync server for my own ebook setup — I built the image and ran it, though I
am not running korrosync day to day — and independent of the timestamp PR (#132). The analysis and the patch were produced with AI assistance and directed by me;
what was executed rather than asserted is under Checks.
1. The image has no runnable default command
Cli::commandis a required subcommand(
cli.rs#L10-L11),and the Dockerfile sets
ENTRYPOINTwith noCMD(
Dockerfile#L50),so the README's own run line
(
README.md#L77-L82)exits 2 with a usage dump. Built from master:
CMD ["serve"]supplies the default. Arguments replaceCMDand notENTRYPOINT, so thesubcommands keep working. Built from this branch:
2. The default database path is inside the container layer
KORROSYNC_DB_PATHdefaulted to/db.redb(
Dockerfile#L44),which is in the writable container layer.
docker rmplus a recreate drops it, which showsup as
401 Invalid credentialsand reads like a password problem rather than an emptydatabase. From the master image:
On this branch the same sequence against a mounted
/datakeeps the user, with no-eflag:
Anyone following your instructions was never at risk:
README.md#L77-L82passes both-v $(pwd)/data:/dataand-e KORROSYNC_DB_PATH=/data/db.redb, which puts the database onthe bind mount. The problem is that the default only works if you copy that line verbatim,
and that the
-eflag exists solely to compensate for a default pointing somewhere unsafe.Making
/data/db.redbthe image default removes the trap, lets the-eline go, and linesthe image up with the application default of
data/db.redb(
config.rs#L28).No VOLUME declaration
My first draft added
VOLUME ["/data"]and I dropped it. Checked with a throwaway imagethat appends to
/data/dbon every run: a plaindocker runattaches a fresh anonymousvolume, so the file was empty again after
docker rmand a recreate, and the two cyclesleft two dangling volumes behind. It also cannot be undeclared downstream. The default path
plus one README sentence is the whole fix.
Breaking change
Moving the default strands the database of anyone who relied on
/db.redb, and it presentsas exactly the
401 Invalid credentialsthis PR is fixing. The commit therefore carries aBREAKING CHANGE:footer, and the README has the upgrade line:That footer will make release-plz cut a minor bump rather than a patch, for a change that
touches no Rust. If you would rather not have that, drop the footer and I will fold the
warning into the release notes by hand instead.
Checks
No
.rsfiles change, so the Rust CI path filters skip this PR. Run anyway innix develop, on this branch:cargo test: 43 unit, 39 integration and 19 doc tests, all passcargo fmt --check,cargo clippy -- -D warnings,cargo machete: cleancargo deny check advisories: fails, and fails identically on master, withRUSTSEC-2026-0233, RUSTSEC-2026-0234 and RUSTSEC-2026-0235 against rkyv 0.8.16 plus a
yanked
spinBoth images were built from this repo and exercised locally, master and this branch; every
transcript above is from those runs.