mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Daniel Nephin](/assets/img/avatar_default.png)
As described in our ROADMAP.md, introduce new Swarm management commands to call to the corresponding API endpoints. This PR is fully backward compatible (joining a Swarm is an optional feature of the Engine, and existing commands are not impacted). Signed-off-by: Daniel Nephin <dnephin@docker.com> Signed-off-by: Victor Vieux <vieux@docker.com> Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
20 lines
582 B
Go
20 lines
582 B
Go
package client
|
|
|
|
import (
|
|
"golang.org/x/net/context"
|
|
|
|
Cli "github.com/docker/docker/cli"
|
|
flag "github.com/docker/docker/pkg/mflag"
|
|
)
|
|
|
|
// CmdTag tags an image into a repository.
|
|
//
|
|
// Usage: docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]
|
|
func (cli *DockerCli) CmdTag(args ...string) error {
|
|
cmd := Cli.Subcmd("tag", []string{"IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]"}, Cli.DockerCommands["tag"].Description, true)
|
|
cmd.Require(flag.Exact, 2)
|
|
|
|
cmd.ParseFlags(args, true)
|
|
|
|
return cli.client.ImageTag(context.Background(), cmd.Arg(0), cmd.Arg(1))
|
|
}
|