Skip to content

0.0.126: generated Dockerfile COPYs runtime-access.sql from context root, but agent stages it under builder/ in the service-dir build context #70

Description

@antoinetoussaint-byte

Root cause (not the same as the #68 symptom)

0.0.126 regressed the store container build again, but the mechanism is now precise and different from #68's "file missing" framing. The generated Dockerfile's COPY path no longer matches where the agent places the file in the build context codefly build service actually uses.

The regression, exactly

VersionGenerated Dockerfile lineruntime-access.sql location in the service-dir build contextBuild
0.0.124COPY builder/runtime-access.sql /app/runtime-access.sqlbuilder/runtime-access.sql✅ builds
0.0.126COPY runtime-access.sql /app/runtime-access.sqlstill builder/runtime-access.sql (nothing at context root)❌ fails

0.0.126 dropped the builder/ prefix from the COPY without relocating the file. In the build context codefly uses (the service directory), there is no runtime-access.sql at the root, so:

#10 [7/7] COPY runtime-access.sql /app/runtime-access.sql
#10 ERROR: failed to compute cache key: "/runtime-access.sql": not found

Proof the recipe content itself is fine — the mismatch is context vs COPY-path

0.0.126 also records a build-recipes/0.0.126/ tree (schema codefly.dev/build-recipe/v1) whose own layout puts runtime-access.sql at the recipe root and the Dockerfile at builder/Dockerfile. Building with the recipe dir as the context succeeds cleanly:

$ cd module/services/store/build-recipes/0.0.126
$ docker build -f builder/Dockerfile .
#11 [7/7] COPY runtime-access.sql /app/runtime-access.sql DONE 0.1s
... naming to ...:latest DONE # image builds + exports

So the recipe is self-consistent when its own directory is the context. But codefly build service runs the build with the service directory (module/services/store/) as the context — where runtime-access.sql lives under builder/, not at the root. The generated Dockerfile's COPY paths (runtime-access.sql, migrations) are written relative to the recipe root, while the build executes against the service-dir root. The two layouts are off by the builder/ level.

Fix (pick the side that owns the contract)

  • Agent-side (matches 0.0.124's working behavior): emit COPY builder/runtime-access.sql /app/runtime-access.sql so the COPY path matches the file's location in the service-dir context; or stage runtime-access.sql at the service-dir context root.
  • Contract-side: if build-recipe/v1 intends the build context to be build-recipes/<version>/ (which builds correctly), the agent's emitted build plan must point codefly build service's context at the recipe dir rather than the service dir.

Either way the invariant to restore is: the context root the build runs against must contain runtime-access.sql at the path the generated Dockerfile COPYs.

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions