mirror of https://github.com/docker/compose.git
Add source policies for build
Build{x,kit} support passing in source policies via an (expirimental) env var. This change adds those policies to the build request. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
8d81b87513
commit
2bf2b22fbe
|
@ -410,6 +410,11 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sp, err := build.ReadSourcePolicy()
|
||||||
|
if err != nil {
|
||||||
|
return build.Options{}, err
|
||||||
|
}
|
||||||
|
|
||||||
return build.Options{
|
return build.Options{
|
||||||
Inputs: build.Inputs{
|
Inputs: build.Inputs{
|
||||||
ContextPath: service.Build.Context,
|
ContextPath: service.Build.Context,
|
||||||
|
@ -417,21 +422,22 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
|
||||||
DockerfilePath: dockerFilePath(service.Build.Context, service.Build.Dockerfile),
|
DockerfilePath: dockerFilePath(service.Build.Context, service.Build.Dockerfile),
|
||||||
NamedContexts: toBuildContexts(service.Build.AdditionalContexts),
|
NamedContexts: toBuildContexts(service.Build.AdditionalContexts),
|
||||||
},
|
},
|
||||||
CacheFrom: pb.CreateCaches(cacheFrom),
|
CacheFrom: pb.CreateCaches(cacheFrom),
|
||||||
CacheTo: pb.CreateCaches(cacheTo),
|
CacheTo: pb.CreateCaches(cacheTo),
|
||||||
NoCache: service.Build.NoCache,
|
NoCache: service.Build.NoCache,
|
||||||
Pull: service.Build.Pull,
|
Pull: service.Build.Pull,
|
||||||
BuildArgs: flatten(resolveAndMergeBuildArgs(s.dockerCli, project, service, options)),
|
BuildArgs: flatten(resolveAndMergeBuildArgs(s.dockerCli, project, service, options)),
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
Target: service.Build.Target,
|
Target: service.Build.Target,
|
||||||
Exports: exports,
|
Exports: exports,
|
||||||
Platforms: plats,
|
Platforms: plats,
|
||||||
Labels: imageLabels,
|
Labels: imageLabels,
|
||||||
NetworkMode: service.Build.Network,
|
NetworkMode: service.Build.Network,
|
||||||
ExtraHosts: service.Build.ExtraHosts.AsList(":"),
|
ExtraHosts: service.Build.ExtraHosts.AsList(":"),
|
||||||
Ulimits: toUlimitOpt(service.Build.Ulimits),
|
Ulimits: toUlimitOpt(service.Build.Ulimits),
|
||||||
Session: sessionConfig,
|
Session: sessionConfig,
|
||||||
Allow: allow,
|
Allow: allow,
|
||||||
|
SourcePolicy: sp,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue