From e81a53eea9d5a44c3fde8d3060845ca18e95b4c4 Mon Sep 17 00:00:00 2001 From: shin- Date: Tue, 30 Apr 2013 06:55:24 -0700 Subject: [PATCH] Added support for REPO:TAG format in docker pull (overrides -t option) --- commands.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index df4746587d..241923cef7 100644 --- a/commands.go +++ b/commands.go @@ -565,6 +565,12 @@ func (srv *Server) CmdPull(stdin io.ReadCloser, stdout io.Writer, args ...string return nil } + if strings.Contains(remote, ":") { + remoteParts := strings.Split(remote, ":") + tag = &remoteParts[1] + remote = remoteParts[0] + } + // FIXME: CmdPull should be a wrapper around Runtime.Pull() if *registry != "" { if err := srv.runtime.graph.PullImage(stdout, remote, *registry, nil); err != nil { @@ -572,7 +578,6 @@ func (srv *Server) CmdPull(stdin io.ReadCloser, stdout io.Writer, args ...string } return nil } - // FIXME: Allow pull repo:tag if err := srv.runtime.graph.PullRepository(stdout, remote, *tag, srv.runtime.repositories, srv.runtime.authConfig); err != nil { return err }