Skip to content

build: fix oci-layout named context serialization#3811

Open
crazy-max wants to merge 2 commits intodocker:masterfrom
crazy-max:fix-oci-layout
Open

build: fix oci-layout named context serialization#3811
crazy-max wants to merge 2 commits intodocker:masterfrom
crazy-max:fix-oci-layout

Conversation

@crazy-max
Copy link
Copy Markdown
Member

@crazy-max crazy-max commented Apr 22, 2026

fixes #3793
needs or closes #3812

The build input path now parses the original OCI layout reference once, resolves the digest when needed, rewrites only the path to the temporary store ID, and serializes the result back through the shared ocilayout.Ref API. This keeps the named context flow from rebuilding the reference by hand and accidentally producing an empty tag segment.

The regression in #3793 came from the named context code path turning a digest-only OCI layout reference into an invalid oci-layout://<store>:@sha256:... form.

Comment thread build/opt_test.go Outdated
Comment on lines +166 to +169
// FIXME: Use a relative temp dir here instead of t.TempDir(). On Windows,
// t.TempDir() returns an absolute path with a drive-letter colon,
// and this test feeds the path through an oci-layout:// ref where
// that colon can be misread as the tag separator.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one looks like a bug in util/ocilayout on Windows. I will open a follow-up PR to fix this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #3812

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max changed the title build: fix digest-only oci-layout named contexts build: fix oci-layout named context serialization Apr 23, 2026
@crazy-max crazy-max marked this pull request as ready for review April 23, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression on digest-only oci-layout:// build contexts

1 participant