|
|
@@ -51,6 +51,7 @@ type configOptions struct {
|
|
|
services bool
|
|
|
volumes bool
|
|
|
networks bool
|
|
|
+ models bool
|
|
|
profiles bool
|
|
|
images bool
|
|
|
hash string
|
|
|
@@ -115,6 +116,9 @@ func configCommand(p *ProjectOptions, dockerCli command.Cli) *cobra.Command {
|
|
|
if opts.networks {
|
|
|
return runNetworks(ctx, dockerCli, opts)
|
|
|
}
|
|
|
+ if opts.models {
|
|
|
+ return runModels(ctx, dockerCli, opts)
|
|
|
+ }
|
|
|
if opts.hash != "" {
|
|
|
return runHash(ctx, dockerCli, opts)
|
|
|
}
|
|
|
@@ -152,6 +156,7 @@ func configCommand(p *ProjectOptions, dockerCli command.Cli) *cobra.Command {
|
|
|
flags.BoolVar(&opts.services, "services", false, "Print the service names, one per line.")
|
|
|
flags.BoolVar(&opts.volumes, "volumes", false, "Print the volume names, one per line.")
|
|
|
flags.BoolVar(&opts.networks, "networks", false, "Print the network names, one per line.")
|
|
|
+ flags.BoolVar(&opts.models, "models", false, "Print the model names, one per line.")
|
|
|
flags.BoolVar(&opts.profiles, "profiles", false, "Print the profile names, one per line.")
|
|
|
flags.BoolVar(&opts.images, "images", false, "Print the image names, one per line.")
|
|
|
flags.StringVar(&opts.hash, "hash", "", "Print the service config hash, one per line.")
|
|
|
@@ -383,6 +388,17 @@ func runNetworks(ctx context.Context, dockerCli command.Cli, opts configOptions)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+func runModels(ctx context.Context, dockerCli command.Cli, opts configOptions) error {
|
|
|
+ project, err := opts.ToProject(ctx, dockerCli, nil, cli.WithoutEnvironmentResolution)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ for n := range project.Models {
|
|
|
+ _, _ = fmt.Fprintln(dockerCli.Out(), n)
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) error {
|
|
|
var services []string
|
|
|
if opts.hash != "*" {
|