Skip to content

fix(docker): make the full image buildable, and fail the release when it is not - #193

Merged
jasdeepkhalsa merged 1 commit into
masterfrom
claude/fix-full-docker-image
Aug 23, 2026
Merged

jasdeepkhalsa merged 1 commit into
masterfrom
claude/fix-full-docker-image

Conversation

@jasdeepkhalsa

Copy link
Copy Markdown
Member

The problem

docker/Dockerfile (the full image) copies scripts/ and tests/ — that image exists for local development and cross-version testing via start.sh — but .dockerignore excluded both:

COPY --chown=root:root --chmod=755 scripts/ scripts/
ERROR: failed to compute cache key: failed to calculate checksum of ref ...: "/scripts": not found

Dockerfile.slim copies neither, which is why only the full image failed.

How long, and what it cost

Broken since 6ef36c5 (2026-03-22, "tighten .dockerignore") — five months.

I checked the registry rather than assuming:

Tag Status
ghcr.io/dbdiff/dbdiff:latest 200
ghcr.io/dbdiff/dbdiff:3.0.0-rc.8 200
ghcr.io/dbdiff/dbdiff:full 404
ghcr.io/dbdiff/dbdiff:full-3.0.0-rc.8 404

The full image has never been published. The documented tag simply does not exist.

Why nobody noticed

The push steps are continue-on-error: true. That is right for a registry outage — a Docker Hub problem should not block GHCR — but it also swallowed a build that could never succeed. buildx logged ##[error] buildx failed with: ERROR: failed to build, and the job still concluded success, so every release reported green while publishing nothing.

The fix

1. .dockerignore no longer excludes scripts/ or tests/. Dockerfile.slim copies neither, so this costs it only build context.

2. Both images are built without pushing, before any push step, and those validation steps are not continue-on-error. A broken Dockerfile now fails the release loudly, while registry resilience is preserved for the actual pushes. Layers land in the gha cache, so the push steps reuse them rather than rebuilding.

Verification

Reproduced the failure locally with podman, then confirmed the fix:

  • full image builds, and contains /usr/src/dbdiff/scripts, /usr/src/dbdiff/tests and /usr/src/dbdiff/src as the Dockerfile intends
  • full image runs (its entrypoint waits on db:3306, the expected compose behaviour)
  • slim image unaffected
  • actionlint clean

Worth considering separately

Images are only built during release.yml, so even with this change a broken Dockerfile is caught at release time rather than on the PR that breaks it. Adding a build-only job to the PR workflow would move that left. Left out here to keep this change focused.

🤖 Generated with Claude Code

… it is not

docker/Dockerfile copies scripts/ and tests/ — that image exists for local
development and cross-version testing via start.sh — but .dockerignore excluded
both, so the build died at the first COPY:

  COPY --chown=root:root --chmod=755 scripts/ scripts/
  ERROR: failed to compute cache key: "/scripts": not found

Broken since 6ef36c5 (2026-03-22, "tighten .dockerignore"). ghcr.io/dbdiff/dbdiff
:full and :full-<version> return 404 — the full image has never been published,
while :latest and the versioned slim tags are fine.

It went unnoticed because the push steps are continue-on-error, which is right
for a registry outage but also swallowed a build that could not succeed at all:
every release reported success.

Two changes:

  - .dockerignore no longer excludes scripts/ or tests/. Dockerfile.slim copies
    neither, so this costs it only build context.

  - both images are now built without pushing, before any push step, and those
    validation steps are NOT continue-on-error. A broken Dockerfile fails the
    release loudly. Layers go to the gha cache, so the push steps reuse them
    rather than rebuilding.

Verified locally with podman: the full image builds, contains scripts/, tests/
and src/ as the Dockerfile intends, and runs; the slim image is unaffected.
actionlint clean.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the bug label Aug 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jasdeepkhalsa
jasdeepkhalsa merged commit 45a80de into master Aug 23, 2026
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant