Пример #1
0
func newResolver(o DockerOptions) (Resolver, error) {
	if o.Socket == "" {
		log.Println("warn: docker socket not configured, docker image puller disabled.")
		return &fakeResolver{}, nil
	}

	c, err := dockerutil.NewClient(o.Auth, o.Socket, o.CertPath)
	return newDockerResolver(c), err
}
Пример #2
0
func newDockerClient(c *cli.Context) (*dockerutil.Client, error) {
	socket := c.String(FlagDockerSocket)
	certPath := c.String(FlagDockerCert)
	auth, err := dockerAuth(c.String(FlagDockerAuth))
	if err != nil {
		return nil, err
	}

	return dockerutil.NewClient(auth, socket, certPath)
}
Пример #3
0
// newTestDockerClient returns a docker.Client configured to talk to the given http.Handler
func newTestDockerClient(t *testing.T, fakeDockerAPI http.Handler) (*dockerutil.Client, *httptest.Server) {
	s := httptest.NewServer(fakeDockerAPI)

	c, err := dockerutil.NewClient(nil, s.URL, "")
	if err != nil {
		t.Fatal(err)
	}

	return c, s
}
Пример #4
0
func newDockerClient(c *Context) (*dockerutil.Client, error) {
	socket := c.String(FlagDockerSocket)
	certPath := c.String(FlagDockerCert)
	authProvider, err := newAuthProvider(c)
	if err != nil {
		return nil, err
	}

	return dockerutil.NewClient(authProvider, socket, certPath)
}
Пример #5
0
func newRunner(o DockerOptions) (*runner.Runner, error) {
	if o.Socket == "" {
		return nil, nil
	}

	c, err := dockerutil.NewClient(o.Auth, o.Socket, o.CertPath)
	if err != nil {
		return nil, err
	}

	return runner.NewRunner(c), nil
}