From b8e338144e90a6bb76110ab04cc216966640a3f4 Mon Sep 17 00:00:00 2001 From: unclejack Date: Fri, 16 May 2014 15:23:47 +0300 Subject: [PATCH] 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 (github: unclejack) --- api/client/commands.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/client/commands.go b/api/client/commands.go index f60b6cebd7..502c1be69e 100644 --- a/api/client/commands.go +++ b/api/client/commands.go @@ -1840,6 +1840,10 @@ func (cli *DockerCli) CmdRun(args ...string) error { v := url.Values{} 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("tag", tag)