|
@@ -68,6 +68,7 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
|
|
{"kill", "Kill a running container"},
|
|
{"kill", "Kill a running container"},
|
|
{"load", "Load an image from a tar archive"},
|
|
{"load", "Load an image from a tar archive"},
|
|
{"login", "Register or log in to the Docker registry server"},
|
|
{"login", "Register or log in to the Docker registry server"},
|
|
|
|
+ {"logout", "Logout of the Docker registry server"},
|
|
{"logs", "Fetch the logs of a container"},
|
|
{"logs", "Fetch the logs of a container"},
|
|
{"port", "Lookup the public-facing port that is NAT-ed to PRIVATE_PORT"},
|
|
{"port", "Lookup the public-facing port that is NAT-ed to PRIVATE_PORT"},
|
|
{"pause", "Pause all processes within a container"},
|
|
{"pause", "Pause all processes within a container"},
|
|
@@ -353,6 +354,36 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// logout of a registry service
|
|
|
|
+func (cli *DockerCli) CmdLogout(args ...string) error {
|
|
|
|
+ cmd := cli.Subcmd("logout", "[SERVER]", "Logout of a docker registry server, if no server is specified \""+registry.IndexServerAddress()+"\" is the default.")
|
|
|
|
+
|
|
|
|
+ if err := cmd.Parse(args); err != nil {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ serverAddress := registry.IndexServerAddress()
|
|
|
|
+ if len(cmd.Args()) > 0 {
|
|
|
|
+ serverAddress = cmd.Arg(0)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ cli.LoadConfigFile()
|
|
|
|
+ if _, ok := cli.configFile.Configs[serverAddress]; !ok {
|
|
|
|
+ fmt.Fprintf(cli.out, "Not logged in to %s\n", serverAddress)
|
|
|
|
+ os.Exit(0)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Fprintf(cli.out, "Remove login credentials for %s\n", serverAddress)
|
|
|
|
+ delete(cli.configFile.Configs, serverAddress)
|
|
|
|
+
|
|
|
|
+ if err := registry.SaveConfig(cli.configFile); err != nil {
|
|
|
|
+ fmt.Fprintln(cli.out, "Failed to save docker config")
|
|
|
|
+ os.Exit(1)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Fprintln(cli.out, "Saved docker config")
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
// 'docker wait': block until a container stops
|
|
// 'docker wait': block until a container stops
|
|
func (cli *DockerCli) CmdWait(args ...string) error {
|
|
func (cli *DockerCli) CmdWait(args ...string) error {
|
|
cmd := cli.Subcmd("wait", "CONTAINER [CONTAINER...]", "Block until a container stops, then print its exit code.")
|
|
cmd := cli.Subcmd("wait", "CONTAINER [CONTAINER...]", "Block until a container stops, then print its exit code.")
|