func GetClient(c *C) dockerclient.Client { context := docker.Context{} err := context.CreateClient() c.Assert(err, IsNil) return context.Client }
// Populate updates the specified docker context based on command line arguments and subcommands. func Populate(context *docker.Context, c *cli.Context) { context.ConfigDir = c.String("configdir") opts := docker.ClientOpts{} 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 := docker.NewDefaultClientFactory(opts) if err != nil { logrus.Fatalf("Failed to construct Docker client: %v", err) } context.ClientFactory = clientFactory }
func Populate(context *docker.Context, c *cli.Context) { context.Tls = c.Bool("tls") context.TlsVerify = c.Bool("tlsverify") context.Ca = c.String("tlscacert") context.Cert = c.String("tlscert") context.Key = c.String("tlskey") context.ConfigDir = c.String("configdir") }