1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/graph/tag.go

19 lines
375 B
Go
Raw Normal View History

package graph
import (
"fmt"
"github.com/docker/docker/engine"
)
func (s *TagStore) CmdTag(job *engine.Job) error {
if len(job.Args) != 2 && len(job.Args) != 3 {
return fmt.Errorf("Usage: %s IMAGE REPOSITORY [TAG]\n", job.Name)
}
var tag string
if len(job.Args) == 3 {
tag = job.Args[2]
}
return s.Set(job.Args[1], tag, job.Args[0], job.GetenvBool("force"))
}