Skip to content

Commit e7e4584

Browse files
committed
Flatten OCI layout root for direct export
1 parent 448e292 commit e7e4584

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/packager/build.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ func BuildModelpack(ctx context.Context, c client.Client) (*client.Result, error
116116
llb.Args([]string{"bash", "-c", script}),
117117
llb.AddMount("/src", modelState, llb.Readonly),
118118
)
119-
final := llb.Scratch().File(llb.Copy(run.Root(), "/layout/", "/"))
119+
final := llb.Scratch().File(llb.Copy(run.Root(), "/layout", "/", &llb.CopyInfo{
120+
CopyDirContentsOnly: true,
121+
}))
120122

121123
result, err := solveAndBuildResult(ctx, c, final, "packager:modelpack")
122124
if err != nil {
@@ -156,7 +158,9 @@ func BuildGeneric(ctx context.Context, c client.Client) (*client.Result, error)
156158
llb.Args([]string{"bash", "-c", script}),
157159
llb.AddMount("/src", srcState, llb.Readonly),
158160
)
159-
final := llb.Scratch().File(llb.Copy(run.Root(), "/layout/", "/"))
161+
final := llb.Scratch().File(llb.Copy(run.Root(), "/layout", "/", &llb.CopyInfo{
162+
CopyDirContentsOnly: true,
163+
}))
160164

161165
result, err := solveAndBuildResult(ctx, c, final, "packager:generic")
162166
if err != nil {

0 commit comments

Comments
 (0)