1

What does "repository" mean to the build process? Why does every image need a repository?

I guess I should take this question up with whoever architect or team made this naming choice but why is there a new "repository" created whenever I build a new image for the same project? I think of repositories a service which stores multiple versions of multiple projects. I don't see why running 'docker build -t localBind9.v02 .' should result in any kind of repo. I had a 'actual' docker repository running at some point but to use that I had to deliberately push an image into it.

1 Answer 1

1

I'm going to share my opinionated definitions that do not match the "official" definitions...

One stores one or more Docker images in a Docker repository (or more precisely, this would be known as repositories in the official definition), locally. I like to call this "the repository" rather than "repositories" when talking about the list of images that appear locally when I do docker images at the command line because "repositories" (plural) sounds confusing from that perspective to a lot of users. I think of the list of Docker images as being more analogous to a Maven repository, rather than some list of individual, separate Git repositories.

This local Docker repository may pull images from a public registry, such as Docker Hub, or a private registry, such as on a private network, for ease of sharing. Additionally, one can push an image to one of these registries.

Each container is an instance of the image (analogous to an object being an instance of a class). There is probably someone out there that thinks this definition is grossly incorrect, but it works for me.

Related:

  1. Difference between Docker registry and repository
  2. What's the Difference Between Docker Images and Containers?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.