diff --git a/internal/build/lifecycle_execution.go b/internal/build/lifecycle_execution.go index df90f3c07c..055b84b15f 100644 --- a/internal/build/lifecycle_execution.go +++ b/internal/build/lifecycle_execution.go @@ -494,7 +494,14 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCach flagsOp := WithFlags(flags...) var analyze RunnerCleaner - if l.opts.Publish { + + layoutOpts := NullOp() + if l.opts.LayoutPath != "" { + args = append([]string{"-layout"}, args...) + layoutOpts = WithBinds(fmt.Sprintf("%s:%s", l.opts.LayoutPath, l.mountPaths.LayoutDir())) + } + + if l.opts.Publish || l.opts.LayoutPath != "" { authConfig, err := auth.BuildEnvVar(authn.DefaultKeychain, l.opts.Image.String(), l.opts.RunImage, l.opts.CacheImage, l.opts.PreviousImage) if err != nil { return err @@ -505,7 +512,7 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCach l, WithLogPrefix("analyzer"), WithImage(l.opts.LifecycleImage), - WithEnv(fmt.Sprintf("%s=%d", builder.EnvUID, l.opts.Builder.UID()), fmt.Sprintf("%s=%d", builder.EnvGID, l.opts.Builder.GID())), + WithEnv(fmt.Sprintf("%s=%d", builder.EnvUID, l.opts.Builder.UID()), fmt.Sprintf("%s=%d", builder.EnvGID, l.opts.Builder.GID()), "CNB_EXPERIMENTAL_MODE=warn"), WithRegistryAccess(authConfig), WithRoot(), WithArgs(l.withLogLevel(args...)...), @@ -513,6 +520,7 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCach flagsOp, cacheBindOp, stackOp, + layoutOpts, ) analyze = phaseFactory.New(configProvider) @@ -677,6 +685,7 @@ func (l *LifecycleExecution) Export(ctx context.Context, buildCache, launchCache opts, WithFlags("-layout"), WithBinds(fmt.Sprintf("%s:%s", l.opts.LayoutPath, l.mountPaths.LayoutDir())), + WithEnv("CNB_EXPERIMENTAL_MODE=warn"), ) } else { opts = append( diff --git a/internal/build/lifecycle_executor.go b/internal/build/lifecycle_executor.go index 4587e08595..6cf7647a66 100644 --- a/internal/build/lifecycle_executor.go +++ b/internal/build/lifecycle_executor.go @@ -30,6 +30,8 @@ var ( api.MustParse("0.8"), api.MustParse("0.9"), api.MustParse("0.10"), + api.MustParse("0.11"), + api.MustParse("0.12"), } ) diff --git a/pkg/client/build.go b/pkg/client/build.go index 729fc49167..738e32554b 100644 --- a/pkg/client/build.go +++ b/pkg/client/build.go @@ -410,6 +410,7 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error { Termui: termui.NewTermui(imageName, ephemeralBuilder, runImageName), SBOMDestinationDir: opts.SBOMDestinationDir, CreationTime: opts.CreationTime, + LayoutPath: layoutRootPath, } lifecycleVersion := ephemeralBuilder.LifecycleDescriptor().Info.Version @@ -418,7 +419,7 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error { lifecycleSupportsCreator := !lifecycleVersion.LessThan(semver.MustParse(minLifecycleVersionSupportingCreator)) if lifecycleSupportsCreator && opts.TrustBuilder(opts.Builder) { - lifecycleOpts.UseCreator = true + lifecycleOpts.UseCreator = false // no need to fetch a lifecycle image, it won't be used if err := c.lifecycleExecutor.Execute(ctx, lifecycleOpts); err != nil { return errors.Wrap(err, "executing lifecycle")