Keep the database files, logs and binaries out of the build context (closes #120) #145

Merged
clawbot merged 1 commits from issue-120-dockerignore into next 2026-10-20 03:58:57 +02:00
Collaborator

Closes #120.

The image ships a tar of the whole build context as its source archive, and the daemon's database is db.sqlite with db.sqlite-wal and db.sqlite-shm, which the *.db patterns never matched.

  • .dockerignore, this repository's own section: **/*.sqlite, **/*.sqlite-wal, **/*.sqlite-shm, and the artifact suffixes .gitignore already lists: **/*.log, **/*.exe, **/*.dll, **/*.so, **/*.dylib.
  • .gitignore: the same three database patterns, unanchored.
  • A test in internal/database opens a database, takes its file name, and checks that .dockerignore has a **/ pattern matching it and its -wal and -shm files.

Not visible in the diff: no tracked path matches any new pattern, and the vendored go-sqlite3 package is unaffected (it is vendored inside the image, and its directory name has no .sqlite suffix).

Disclosures:

  • .gitignore changed beyond the expected file list, because the definition of done asks for it.
  • *.exe~ is not added: the shared **/*~ already excludes it.
  • The test strips **/ and uses filepath.Match rather than Docker's own matcher, to add no dependency; it would not see a later ! line re-including the files.
  • The probe-image check from the definition of done was done by hand; it is not part of the test suite.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/routewatch/issues/120. The image ships a tar of the whole build context as its source archive, and the daemon's database is `db.sqlite` with `db.sqlite-wal` and `db.sqlite-shm`, which the `*.db` patterns never matched. - `.dockerignore`, this repository's own section: `**/*.sqlite`, `**/*.sqlite-wal`, `**/*.sqlite-shm`, and the artifact suffixes `.gitignore` already lists: `**/*.log`, `**/*.exe`, `**/*.dll`, `**/*.so`, `**/*.dylib`. - `.gitignore`: the same three database patterns, unanchored. - A test in `internal/database` opens a database, takes its file name, and checks that `.dockerignore` has a `**/` pattern matching it and its `-wal` and `-shm` files. Not visible in the diff: no tracked path matches any new pattern, and the vendored `go-sqlite3` package is unaffected (it is vendored inside the image, and its directory name has no `.sqlite` suffix). Disclosures: - `.gitignore` changed beyond the expected file list, because the definition of done asks for it. - `*.exe~` is not added: the shared `**/*~` already excludes it. - The test strips `**/` and uses `filepath.Match` rather than Docker's own matcher, to add no dependency; it would not see a later `!` line re-including the files. - The probe-image check from the definition of done was done by hand; it is not part of the test suite. Model: opus-5-5
clawbot added the needs-review label 2026-10-20 03:53:18 +02:00
clawbot self-assigned this 2026-10-20 03:53:19 +02:00
clawbot added 1 commit 2026-10-20 03:53:19 +02:00
The daemon's database is db.sqlite with its -wal and -shm files, which
the .db patterns in .dockerignore and .gitignore did not match, so a
database left in the clone shipped in the image's source archive.
.dockerignore now also excludes the logs and the .exe, .dll, .so and
.dylib files .gitignore already ignores. A test opens a database and
checks that .dockerignore has an any-depth pattern for each of its
files.

Model: opus-5-5
Author
Collaborator
  1. The PR title, "Keep the database files, logs and binaries out of the build context", does not end with (closes #120). A squash merge into next that takes its subject from the title would land without the reference, so the landing commit would not close #120. Acceptable: retitle the PR to "Keep the database files, logs and binaries out of the build context (closes #120)". The files and the commit need no change.

Model: opus-5-5

1. The PR title, "Keep the database files, logs and binaries out of the build context", does not end with ` (closes #120)`. A squash merge into `next` that takes its subject from the title would land without the reference, so the landing commit would not close https://git.eeqj.de/sneak/routewatch/issues/120. Acceptable: retitle the PR to "Keep the database files, logs and binaries out of the build context (closes #120)". The files and the commit need no change. Model: opus-5-5
clawbot changed title from Keep the database files, logs and binaries out of the build context to Keep the database files, logs and binaries out of the build context (closes #120) 2026-10-20 03:58:50 +02:00
clawbot merged commit 9280e2eb2c into next 2026-10-20 03:58:57 +02:00
clawbot deleted branch issue-120-dockerignore 2026-10-20 03:58:57 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#145