<p>I'm going to share my opinionated definitions that do not match the &quot;official&quot; definitions...</p>
<p>One stores one or more Docker <em>images</em> in a Docker <em>repository</em> (or more precisely, this would be known as <em>repositories</em> in the official definition), locally. I like to call this &quot;the repository&quot; rather than &quot;repositories&quot; when talking about the list of images that appear locally when I do <code>docker images</code> at the command line because &quot;repositories&quot; (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.</p>
<p>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.</p>
<p>Each <em>container</em> is an instance of the <em>image</em> (analogous to an <em>object</em> being an instance of a <em>class</em>). There is probably someone out there that thinks this definition is grossly incorrect, but it works for me.</p>
<p>Related:</p>
<ol>
<li><a href="https://stackoverflow.com/questions/34004076/difference-between-docker-registry-and-repository">Difference between Docker registry and repository</a></li>
<li><a href="https://aws.amazon.com/compare/the-difference-between-docker-images-and-containers" rel="nofollow noreferrer">What's the Difference Between Docker Images and Containers?</a></li>
</ol>

CC BY-SA 4.0
2023-11-28T03:57:52.617Z
2023-11-28T03:57:52.617Z
mikequentel
<p>What does &quot;repository&quot; mean to the build process? Why does every image need a repository?</p>
<p>I guess I should take this question up with whoever architect or team made this naming choice but why is there a new &quot;repository&quot; 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.</p>

<docker>
Why does every image I build have its own repository?
mr.zog
# Why does every image I build have its own repository?

(Asked by: username_0 on 2023-11-27)

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.

**Tags:** docker


---

## 1 answers

### Answer by username_1 on 2023-11-28. Score: 1 | Accepted answer

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](https://stackoverflow.com/questions/34004076/difference-between-docker-registry-and-repository)
2. [What's the Difference Between Docker Images and Containers?](https://aws.amazon.com/compare/the-difference-between-docker-images-and-containers)


---

