MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / Login

Method Login

docker/client.go:35–60  ·  view source on GitHub ↗
(userName, password, proxyURL string)

Source from the content-addressed store, hash-verified

33}
34
35func (c *Client) Login(userName, password, proxyURL string) error {
36 // NOTE: use slightly different implementation to hide password in output
37 //return c.exec(c.dockerBin, "login", "-u", userName, "-p", password, proxyURL)
38
39 console.Blank()
40 console.ShellCommand(c.dockerBin + " login -u " + userName + " -p ****** " + proxyURL)
41
42 stdout, stderr, exit, err := exec.Exec(c.dockerBin, "login", "-u", userName, "-p", password, proxyURL)
43 if err != nil {
44 return err
45 }
46
47 for {
48 select {
49 case line := <-stdout:
50 console.ShellOutput(line)
51 case line := <-stderr:
52 console.ShellError(line)
53 case exitErr := <-exit:
54 console.Blank()
55 return exitErr
56 }
57 }
58
59 return nil
60}
61
62func (c *Client) PushImage(image string) error {
63 return c.exec(c.dockerBin, "push", image)

Callers 1

pushDockerImageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected