Windows: Support credential specs

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2016-06-07 12:15:50 -07:00
parent 8691f7c542
commit e307da732a
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,7 @@ type buildOptions struct {
pull bool pull bool
cacheFrom []string cacheFrom []string
compress bool compress bool
securityOpt []string
} }
// NewBuildCommand creates a new `docker build` command // NewBuildCommand creates a new `docker build` command
@ -103,6 +104,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command {
flags.BoolVar(&options.pull, "pull", false, "Always attempt to pull a newer version of the image") flags.BoolVar(&options.pull, "pull", false, "Always attempt to pull a newer version of the image")
flags.StringSliceVar(&options.cacheFrom, "cache-from", []string{}, "Images to consider as cache sources") flags.StringSliceVar(&options.cacheFrom, "cache-from", []string{}, "Images to consider as cache sources")
flags.BoolVar(&options.compress, "compress", false, "Compress the build context using gzip") flags.BoolVar(&options.compress, "compress", false, "Compress the build context using gzip")
flags.StringSliceVar(&options.securityOpt, "security-opt", []string{}, "Security options")
command.AddTrustedFlags(flags, true) command.AddTrustedFlags(flags, true)
@ -299,6 +301,7 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
AuthConfigs: authConfig, AuthConfigs: authConfig,
Labels: runconfigopts.ConvertKVStringsToMap(options.labels.GetAll()), Labels: runconfigopts.ConvertKVStringsToMap(options.labels.GetAll()),
CacheFrom: options.cacheFrom, CacheFrom: options.cacheFrom,
SecurityOpt: options.securityOpt,
} }
response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions) response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions)