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