2014-08-05 02:49:10 -04:00
|
|
|
package graph
|
|
|
|
|
|
|
|
import (
|
2015-03-25 03:44:12 -04:00
|
|
|
"fmt"
|
|
|
|
|
2014-08-05 02:49:10 -04:00
|
|
|
"github.com/docker/docker/engine"
|
|
|
|
)
|
|
|
|
|
2015-03-25 03:44:12 -04:00
|
|
|
func (s *TagStore) CmdTag(job *engine.Job) error {
|
2014-08-05 02:49:10 -04:00
|
|
|
if len(job.Args) != 2 && len(job.Args) != 3 {
|
2015-03-25 03:44:12 -04:00
|
|
|
return fmt.Errorf("Usage: %s IMAGE REPOSITORY [TAG]\n", job.Name)
|
2014-08-05 02:49:10 -04:00
|
|
|
}
|
|
|
|
var tag string
|
|
|
|
if len(job.Args) == 3 {
|
|
|
|
tag = job.Args[2]
|
|
|
|
}
|
2015-03-25 03:44:12 -04:00
|
|
|
return s.Set(job.Args[1], tag, job.Args[0], job.GetenvBool("force"))
|
2014-08-05 02:49:10 -04:00
|
|
|
}
|