@@ -11,6 +11,7 @@ import (
11
11
"github.com/Azure/dalec/frontend"
12
12
"github.com/moby/buildkit/client/llb"
13
13
gwclient "github.com/moby/buildkit/frontend/gateway/client"
14
+ "github.com/moby/buildkit/util/bklog"
14
15
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
15
16
)
16
17
@@ -33,7 +34,7 @@ func handleContainer(ctx context.Context, client gwclient.Client) (*gwclient.Res
33
34
}
34
35
35
36
worker := getWorkerImage (client , pg )
36
- st , err := specToContainerLLB (spec , targetKey , worker , rpmDir , sOpt , pg )
37
+ st , err := specToContainerLLB (ctx , spec , targetKey , worker , rpmDir , sOpt , pg )
37
38
if err != nil {
38
39
return nil , nil , err
39
40
}
@@ -69,7 +70,7 @@ func handleContainer(ctx context.Context, client gwclient.Client) (*gwclient.Res
69
70
})
70
71
}
71
72
72
- func specToContainerLLB (spec * dalec.Spec , target string , builderImg llb.State , rpmDir llb.State , sOpt dalec.SourceOpts , opts ... llb.ConstraintsOpt ) (llb.State , error ) {
73
+ func specToContainerLLB (ctx context. Context , spec * dalec.Spec , target string , builderImg llb.State , rpmDir llb.State , sOpt dalec.SourceOpts , opts ... llb.ConstraintsOpt ) (llb.State , error ) {
73
74
opts = append (opts , dalec .ProgressGroup ("Install RPMs" ))
74
75
const workPath = "/tmp/rootfs"
75
76
@@ -126,7 +127,13 @@ rm -rf ` + rpmdbDir + `
126
127
127
128
installer := llb .Scratch ().File (llb .Mkfile ("install.sh" , 0o755 , []byte (installCmd )), opts ... )
128
129
129
- baseImg := llb .Image (frontend .GetBaseOutputImage (spec , target , marinerDistrolessRef ), llb .WithMetaResolver (sOpt .Resolver ), dalec .WithConstraints (opts ... ))
130
+ baseImg := llb .Scratch ()
131
+
132
+ baseRef := frontend .GetBaseOutputImage (spec , target , "" )
133
+ if baseRef != "" {
134
+ bklog .G (ctx ).WithField ("baseRef" , baseRef ).Debugf ("Using custom base image rootfs" )
135
+ baseImg = llb .Image (baseRef , llb .WithMetaResolver (sOpt .Resolver ), dalec .WithConstraints (opts ... ))
136
+ }
130
137
worker := builderImg .
131
138
Run (
132
139
shArgs ("/tmp/install.sh" ),
0 commit comments