mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-03 20:27:46 +08:00
change image build method
This commit is contained in:
parent
05ec6bdd51
commit
8ea774e989
@ -146,6 +146,11 @@ func (s *slugBuild) buildRunnerImage(slugPackage string) (string, error) {
|
||||
} else {
|
||||
runbuildOptions.NoCache = false
|
||||
}
|
||||
// pull image runner
|
||||
if _, err := sources.ImagePull(s.re.DockerClient, builder.RUNNERIMAGENAME, builder.REGISTRYUSER, builder.REGISTRYPASS, s.re.Logger, 30); err != nil {
|
||||
return "", fmt.Errorf("pull image %s: %v", builder.RUNNERIMAGENAME, err)
|
||||
}
|
||||
logrus.Infof("pull image %s successfully.", builder.RUNNERIMAGENAME)
|
||||
err := sources.ImageBuild(s.re.DockerClient, cacheDir, runbuildOptions, s.re.Logger, 30)
|
||||
if err != nil {
|
||||
s.re.Logger.Error(fmt.Sprintf("build image %s of new version failure", imageName), map[string]string{"step": "builder-exector", "status": "failure"})
|
||||
|
@ -366,12 +366,6 @@ func ImageBuild(dockerCli *client.Client, contextDir string, options types.Image
|
||||
return err
|
||||
}
|
||||
|
||||
// pull image runner
|
||||
if _, err := ImagePull(dockerCli, builder.RUNNERIMAGENAME, builder.REGISTRYUSER, builder.REGISTRYPASS, logger, timeout); err != nil {
|
||||
return fmt.Errorf("pull image %s: %v", builder.RUNNERIMAGENAME, err)
|
||||
}
|
||||
logrus.Infof("pull image %s successfully.", builder.RUNNERIMAGENAME)
|
||||
|
||||
rc, err := dockerCli.ImageBuild(ctx, buildCtx, options)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user