6

I'm reasonably familiar with Docker at this point but as these things go I'm no expert.

When I do a docker push, I always (?) get what looks like an informative message: The push refers to a repository [registry.bigco.com/foobar/blatz].

Empirically it looks like if I use the command line tools, I will get this message if I do:

docker push registry.bigco.com/foobar/blatz

(In this case if I've got several registry.bigco.com/foobar/blatz images tagged with "colon tags" (e.g. registry.bigco.com/foobar/blatz:development) lying around in my local Docker environment, then this operation will push them all.)

I'll also get it if I do:

docker push registry.bigco.com/foobar/blatz:development

…i.e. a specific tag. That surprises me, because I figured the presence of the development "colon tag" picks out a very specific image I'm pushing, and not the contents of my local Docker environment, and, indeed, that's all that gets pushed. That is, if I'm understanding what "repository" means in this case, I'm certainly trying not to refer to a repository at all!

What is this message trying to tell me? Is it trying, actually, to tell me that my push operation is referring to a registry, i.e. that the registry.bigco.com part is being treated as not a username on Docker Hub? Is this a gigantic typo?

Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
  • Possible duplicate of [Difference between Docker registry and repository](https://stackoverflow.com/questions/34004076/difference-between-docker-registry-and-repository) – user3151902 Sep 15 '17 at 06:10
  • Hi; thanks; I don't think this is a duplicate. For example, [this answer](https://stackoverflow.com/a/39904365/208288) implies that if I push an _image_, indeed I should not be told that I am pushing a _repository_. So I am still trying to understand the notification message described above. – Laird Nelson Sep 17 '17 at 19:53
  • OK, the message might be a bit misleading, I think changing it to "refers to *the* repository" might make it more clear. If you have a look at [the source](https://github.com/docker/docker-ce/blob/master/components/engine/distribution/push.go#L72), you will see that the message is always printed, whether you are pushing a single image or a whole repository. It merely states the source of the images that are being pushed. – user3151902 Sep 17 '17 at 20:06
  • Thank you; so in effect, a push can refer to nothing else, right? As in, this message is entirely superfluous? – Laird Nelson Sep 18 '17 at 18:43
  • 2
    Yes, a push will always refer to a repository. The message is not superfluous, however, as it tells the user how Docker has resolved the given arguments. Try `docker push lalala` and you will see which repository docker assumes: "The push refers to a repository [docker.io/library/lalala]" – user3151902 Sep 18 '17 at 18:48
  • OK, so to sum up: even though I think I am pushing an _image_, I am always pushing a _repository_, even when I am pushing `some/thing:likethis`? And the message is telling me, superfluously, that I am pushing a repository—it's the only thing I can push—but, helpfully, that is named thus-and-such…? Sorry for these thick-headed questions; I like my terminology to be unambiguous. – Laird Nelson Sep 19 '17 at 03:28
  • Sorry, my last comment was a bit confusing. You _can_ push a single image. Taking the previous example, `docker push lalala:mytag` will only push the image with this specific tag. However, one might think that the full name of the lalala repository is (for example) myregistry.io/user1/lalala. So, just to be sure, docker will print the *full* repository name it will actually use: docker.io/library/lalala. As ":mytag" was specified, *only* this tag will be pushed. – user3151902 Sep 19 '17 at 04:52

0 Answers0