@@ -460,6 +460,7 @@ func updateGetAgent(client *api.Client) (*deploy.DeployAgent, error) {
OverrideTag: tag,
Method: buildMethod,
AdditionalEnv: additionalEnv,
+ UseCache: useCache,
},
Local: source != "github",
})
@@ -49,6 +49,7 @@ func (b *BuildAgent) BuildDocker(
Env: b.env,
DockerfilePath: dockerfilePath,
IsDockerfileInCtx: isDockerfileInCtx,
+ UseCache: b.UseCache,
}
return dockerAgent.BuildLocal(
@@ -78,6 +79,7 @@ func (b *BuildAgent) BuildPack(dockerAgent *docker.Agent, dst, tag, prevTag stri
Tag: tag,
BuildContext: dst,
// call builder
@@ -19,6 +19,7 @@ type SharedOpts struct {
Method DeployBuildType
AdditionalEnv map[string]string
EnvGroups []types.EnvGroupMeta
+ UseCache bool
func coalesceEnvGroups(
@@ -25,6 +25,7 @@ type BuildOpts struct {
BuildContext string
DockerfilePath string
IsDockerfileInCtx bool
Env map[string]string
@@ -43,8 +43,11 @@ func (a *Agent) Build(opts *docker.BuildOpts, buildConfig *types.BuildConfig, dc
Builder: "paketobuildpacks/builder:full",
AppPath: opts.BuildContext,
Env: opts.Env,
- CacheImage: cacheImage,
- Publish: true,
+ }
+
+ if opts.UseCache {
+ buildOpts.CacheImage = cacheImage
+ buildOpts.Publish = true
if buildConfig != nil {