@@ -27,6 +27,7 @@ import (
27
27
28
28
"github.com/kballard/go-shellquote"
29
29
"github.com/mattn/go-isatty"
30
+ cp "github.com/otiai10/copy"
30
31
31
32
"github.com/GoogleContainerTools/kaniko/pkg/config"
32
33
"github.com/GoogleContainerTools/kaniko/pkg/creds"
@@ -343,8 +344,14 @@ func Run(ctx context.Context, options Options) error {
343
344
}
344
345
345
346
if options .PushImage {
347
+ // Copy the envbuilder binary into the build context.
348
+ binPath := filepath .Join (MagicDir , "bin" , "envbuilder" )
349
+ err := cp .Copy (binPath , filepath .Join (buildParams .BuildContext , binPath ))
350
+ if err != nil {
351
+ return err
352
+ }
346
353
buildParams .DockerfileContent = buildParams .DockerfileContent + "\n " +
347
- "COPY .envbuilder .envbuilder"
354
+ "COPY " + binPath + " " + binPath
348
355
}
349
356
350
357
HijackLogrus (func (entry * logrus.Entry ) {
@@ -526,7 +533,7 @@ func Run(ctx context.Context, options Options) error {
526
533
// https://github.com/coder/envbuilder/pull/114
527
534
RegistryMirrors : registryMirror ,
528
535
},
529
- SrcContext : "/" ,
536
+ SrcContext : buildParams . BuildContext ,
530
537
531
538
// For cached image utilization, produce reproducible builds.
532
539
Reproducible : options .PushImage ,
0 commit comments