Переглянути джерело

docker build: pull just latest if tag uspecified

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
unclejack 11 роки тому
батько
коміт
6ba5d67a51
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      builder/internals.go

+ 3 - 0
builder/internals.go

@@ -271,6 +271,9 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
 
 func (b *Builder) pullImage(name string) (*imagepkg.Image, error) {
 	remote, tag := parsers.ParseRepositoryTag(name)
+	if tag == "" {
+		tag = "latest"
+	}
 	pullRegistryAuth := b.AuthConfig
 	if len(b.AuthConfigFile.Configs) > 0 {
 		// The request came with a full auth config file, we prefer to use that