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
| Version | Generated Dockerfile line | runtime-access.sql location in the service-dir build context | Build |
|---|
| 0.0.124 | COPY builder/runtime-access.sql /app/runtime-access.sql | builder/runtime-access.sql | ✅ builds |
| 0.0.126 | COPY runtime-access.sql /app/runtime-access.sql | still 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
Root cause (not the same as the #68 symptom)
0.0.126 regressed the
storecontainer build again, but the mechanism is now precise and different from #68's "file missing" framing. The generated Dockerfile'sCOPYpath no longer matches where the agent places the file in the build contextcodefly build serviceactually uses.The regression, exactly
COPY builder/runtime-access.sql /app/runtime-access.sqlbuilder/runtime-access.sqlCOPY runtime-access.sql /app/runtime-access.sqlbuilder/runtime-access.sql(nothing at context root)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 noruntime-access.sqlat the root, so: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 (schemacodefly.dev/build-recipe/v1) whose own layout putsruntime-access.sqlat the recipe root and the Dockerfile atbuilder/Dockerfile. Building with the recipe dir as the context succeeds cleanly:So the recipe is self-consistent when its own directory is the context. But
codefly build serviceruns the build with the service directory (module/services/store/) as the context — whereruntime-access.sqllives underbuilder/, 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 thebuilder/level.Fix (pick the side that owns the contract)
COPY builder/runtime-access.sql /app/runtime-access.sqlso the COPY path matches the file's location in the service-dir context; or stageruntime-access.sqlat the service-dir context root.build-recipe/v1intends the build context to bebuild-recipes/<version>/(which builds correctly), the agent's emitted build plan must pointcodefly 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.sqlat the path the generated Dockerfile COPYs.Environment
go install github.com/codefly-dev/cli/cmd/codefly@latest→ cli v0.1.139,codefly build service.postgresservice withspec.runtime-read-write-roles. 0.0.124 builds; 0.0.125 and 0.0.126 fail (different COPY paths, same root mismatch).