code: func Populate(context *ctx.Context, c *cli.Context) {
  	command.Populate(&context.Context, c)
  
  	context.ConfigDir = c.String("configdir")
  
  	opts := client.Options{}
  	opts.TLS = c.GlobalBool("tls")
  	opts.TLSVerify = c.GlobalBool("tlsverify")
  	opts.TLSOptions.CAFile = c.GlobalString("tlscacert")
  	opts.TLSOptions.CertFile = c.GlobalString("tlscert")
  	opts.TLSOptions.KeyFile = c.GlobalString("tlskey")
  
  	clientFactory, err := client.NewDefaultFactory(opts)
  	if err != nil {
  		logrus.Fatalf("Failed to construct Docker client: %v", err)
  	}
  
  	context.ClientFactory = clientFactory
  }
docs: // Populate updates the specified docker context based on command line arguments and subcommands.