Skip to content

Commit 52af388

Browse files
committed
WIP - working version using command: ./out/pack build oci:oci-example --builder cnbs/jbustamantevmware-builder:bionic --verbose --path /Users/jbustamante/workspace/buildpack.io/samples/apps/java-maven --verbose --trust-builder
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
1 parent a409fc5 commit 52af388

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

internal/build/lifecycle_execution.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,14 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCach
494494
flagsOp := WithFlags(flags...)
495495

496496
var analyze RunnerCleaner
497-
if l.opts.Publish {
497+
498+
layoutOpts := NullOp()
499+
if l.opts.LayoutPath != "" {
500+
args = append([]string{"-layout"}, args...)
501+
layoutOpts = WithBinds(fmt.Sprintf("%s:%s", l.opts.LayoutPath, l.mountPaths.LayoutDir()))
502+
}
503+
504+
if l.opts.Publish || l.opts.LayoutPath != "" {
498505
authConfig, err := auth.BuildEnvVar(authn.DefaultKeychain, l.opts.Image.String(), l.opts.RunImage, l.opts.CacheImage, l.opts.PreviousImage)
499506
if err != nil {
500507
return err
@@ -505,14 +512,15 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCach
505512
l,
506513
WithLogPrefix("analyzer"),
507514
WithImage(l.opts.LifecycleImage),
508-
WithEnv(fmt.Sprintf("%s=%d", builder.EnvUID, l.opts.Builder.UID()), fmt.Sprintf("%s=%d", builder.EnvGID, l.opts.Builder.GID())),
515+
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"),
509516
WithRegistryAccess(authConfig),
510517
WithRoot(),
511518
WithArgs(l.withLogLevel(args...)...),
512519
WithNetwork(l.opts.Network),
513520
flagsOp,
514521
cacheBindOp,
515522
stackOp,
523+
layoutOpts,
516524
)
517525

518526
analyze = phaseFactory.New(configProvider)
@@ -677,6 +685,7 @@ func (l *LifecycleExecution) Export(ctx context.Context, buildCache, launchCache
677685
opts,
678686
WithFlags("-layout"),
679687
WithBinds(fmt.Sprintf("%s:%s", l.opts.LayoutPath, l.mountPaths.LayoutDir())),
688+
WithEnv("CNB_EXPERIMENTAL_MODE=warn"),
680689
)
681690
} else {
682691
opts = append(

internal/build/lifecycle_executor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ var (
3030
api.MustParse("0.8"),
3131
api.MustParse("0.9"),
3232
api.MustParse("0.10"),
33+
api.MustParse("0.11"),
34+
api.MustParse("0.12"),
3335
}
3436
)
3537

pkg/client/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
410410
Termui: termui.NewTermui(imageName, ephemeralBuilder, runImageName),
411411
SBOMDestinationDir: opts.SBOMDestinationDir,
412412
CreationTime: opts.CreationTime,
413+
LayoutPath: layoutRootPath,
413414
}
414415

415416
lifecycleVersion := ephemeralBuilder.LifecycleDescriptor().Info.Version
@@ -418,7 +419,7 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
418419
lifecycleSupportsCreator := !lifecycleVersion.LessThan(semver.MustParse(minLifecycleVersionSupportingCreator))
419420

420421
if lifecycleSupportsCreator && opts.TrustBuilder(opts.Builder) {
421-
lifecycleOpts.UseCreator = true
422+
lifecycleOpts.UseCreator = false
422423
// no need to fetch a lifecycle image, it won't be used
423424
if err := c.lifecycleExecutor.Execute(ctx, lifecycleOpts); err != nil {
424425
return errors.Wrap(err, "executing lifecycle")

0 commit comments

Comments
 (0)