File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 66 "fmt"
77 "maps"
88 "os"
9+ "os/exec"
910 "slices"
1011
1112 "github.com/spf13/cobra"
6869 fmt .Printf ("Version: %s\n " , manifest .Version )
6970 fmt .Printf ("TEE: %s\n " , manifest .TEE )
7071 fmt .Printf ("Kind: %s\n " , manifest .Kind )
72+ fmt .Println ()
7173
7274 switch deployment .Debug {
7375 case true :
@@ -104,6 +106,22 @@ var (
104106 )
105107 containerEnv .AddDirectory (tmpDir )
106108 buildEnv = containerEnv
109+
110+ if buildEnv .IsAvailable () {
111+ fmt .Printf ("Initializing build environment...\n " )
112+ // Run a dummy command to make sure that all necessary Docker layers
113+ // for the build environment are downloaded at the start instead of
114+ // later in the build process.
115+ cmd := exec .Command ("true" )
116+ cmd .Stdout = os .Stdout
117+ cmd .Stderr = os .Stderr
118+ if err = buildEnv .WrapCommand (cmd ); err != nil {
119+ return fmt .Errorf ("unable to wrap command: %w" , err )
120+ }
121+ if err = cmd .Run (); err != nil {
122+ return fmt .Errorf ("failed to initialize build environment: %w" , err )
123+ }
124+ }
107125 }
108126
109127 if ! buildEnv .IsAvailable () {
You can’t perform that action at this time.
0 commit comments