Explorar o código

run: pull only latest when no tag specified

This makes Docker pull only the image tagged as latest when no tag has
been specified. This makes Docker pull only the image it'll run.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
unclejack %!s(int64=11) %!d(string=hai) anos
pai
achega
b8e338144e
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      api/client/commands.go

+ 4 - 0
api/client/commands.go

@@ -1840,6 +1840,10 @@ func (cli *DockerCli) CmdRun(args ...string) error {
 
 
 		v := url.Values{}
 		v := url.Values{}
 		repos, tag := utils.ParseRepositoryTag(config.Image)
 		repos, tag := utils.ParseRepositoryTag(config.Image)
+		// pull only the image tagged 'latest' if no tag was specified
+		if tag == "" {
+			tag = "latest"
+		}
 		v.Set("fromImage", repos)
 		v.Set("fromImage", repos)
 		v.Set("tag", tag)
 		v.Set("tag", tag)