You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: What is a registry? This Docker Concept will explain what a registry is, explore their interoperability, and have you interact with registries.
Now that you know what a container image is and how it works, you might wonder - where do you store these images?
16
+
Now that you know what a container image is and how it works, you might wonder - where do you store these images?
17
17
18
18
Well, you can store your container images on your computer system, but what if you want to share them with your friends or use them on another machine? That's where the image registry comes in.
19
19
20
-
An image registry is a centralized location for storing and sharing your container images. It can be either public or private. [Docker Hub](https://hub.docker.com) is a public registry that anyone can use and is the default registry.
20
+
An image registry is a centralized location for storing and sharing your container images. It can be either public or private. [Docker Hub](https://hub.docker.com) is a public registry that anyone can use and is the default registry.
21
21
22
22
While Docker Hub is a popular option, there are many other available container registries available today, including [Amazon Elastic Container Registry (ECR)](https://aws.amazon.com/ecr/), [Azure Container Registry (ACR)](https://azure.microsoft.com/en-in/products/container-registry), and [Google Container Registry (GCR)](https://cloud.google.com/artifact-registry). You can even run your private registry on your local system or inside your organization. For example, Harbor, JFrog Artifactory, GitLab Container registry etc.
23
23
@@ -29,32 +29,24 @@ A _registry_ is a centralized location that stores and manages container images,
29
29
30
30
The following diagram shows the relationship between a registry, repositories, and images.
31
31
32
-
```goat {class="text-sm"}
33
-
+---------------------------------------+
34
-
| Registry |
35
-
|---------------------------------------|
36
-
| |
37
-
| +-----------------------------+ |
38
-
| | Repository A | |
39
-
| |-----------------------------| |
40
-
| | Image: project-a:v1.0 | |
41
-
| | Image: project-a:v2.0 | |
42
-
| +-----------------------------+ |
43
-
| |
44
-
| +-----------------------------+ |
45
-
| | Repository B | |
46
-
| |-----------------------------| |
47
-
| | Image: project-b:v1.0 | |
48
-
| | Image: project-b:v1.1 | |
49
-
| | Image: project-b:v2.0 | |
50
-
| +-----------------------------+ |
51
-
| |
52
-
+---------------------------------------+
32
+
```mermaid
33
+
flowchart TB
34
+
subgraph Registry
35
+
subgraph A["Repository A"]
36
+
A1["project-a:v1.0"]
37
+
A2["project-a:v2.0"]
38
+
end
39
+
subgraph B["Repository B"]
40
+
B1["project-b:v1.0"]
41
+
B2["project-b:v1.1"]
42
+
B3["project-b:v2.0"]
43
+
end
44
+
end
53
45
```
54
46
55
47
> [!TIP]
56
48
>
57
-
>A Docker Personal plan gives you one private repository and unlimited public repositories. To get unlimited private repositories, upgrade to the [Docker Team plan](https://www.docker.com/pricing?ref=Docs&refAction=DocsConceptsRegistry).
49
+
>A Docker Personal plan gives you one private repository and unlimited public repositories. To get unlimited private repositories, upgrade to the [Docker Team plan](https://www.docker.com/pricing?ref=Docs&refAction=DocsConceptsRegistry).
58
50
59
51
## Try it out
60
52
@@ -64,19 +56,19 @@ In this hands-on, you will learn how to build and push a Docker image to the Doc
64
56
65
57
1. If you haven't created one yet, head over to the [Docker Hub](https://hub.docker.com) page to sign up for a new Docker account. Be sure to finish the verification steps sent to your email.
66
58
67
-

59
+

68
60
69
-
You can use your Google or GitHub account to authenticate.
61
+
You can use your Google or GitHub account to authenticate.
70
62
71
63
### Create your first repository
72
64
73
65
1. Sign in to [Docker Hub](https://hub.docker.com).
74
66
2. Select the **Create repository** button in the top-right corner.
75
67
3. Select your namespace (most likely your username) and enter `docker-quickstart` as the repository name.
76
68
77
-

69
+

78
70
79
-
4. Set the visibility to **Public**.
71
+
4. Set the visibility to **Public**.
80
72
5. Select the **Create** button to create the repository.
81
73
82
74
That's it. You've successfully created your first repository. 🎉
@@ -96,62 +88,62 @@ Don't worry about the specifics of the Dockerfile, as you'll learn about that in
96
88
97
89
1. Clone the GitHub repository using the following command:
> Make sure you include the dot (.) at the end of the `docker build` command. This tells Docker where to find the Dockerfile.
107
+
> [!NOTE]
108
+
>
109
+
> Make sure you include the dot (.) at the end of the `docker build` command. This tells Docker where to find the Dockerfile.
118
110
119
111
4. Run the following command to list the newly created Docker image:
120
112
121
-
```console
122
-
docker images
123
-
```
113
+
```console
114
+
docker images
115
+
```
124
116
125
-
You will see output like the following:
117
+
You will see output like the following:
126
118
127
-
```console
128
-
REPOSITORY TAG IMAGE ID CREATED SIZE
129
-
<YOUR_DOCKER_USERNAME>/docker-quickstart latest 476de364f70e 2 minutes ago 170MB
130
-
```
119
+
```console
120
+
REPOSITORY TAG IMAGE ID CREATED SIZE
121
+
<YOUR_DOCKER_USERNAME>/docker-quickstart latest 476de364f70e 2 minutes ago 170MB
122
+
```
131
123
132
124
5. Start a container to test the image by running the following command (swap out the username with your own username):
133
125
134
-
```console
135
-
docker run -d -p 8080:8080 <YOUR_DOCKER_USERNAME>/docker-quickstart
136
-
```
126
+
```console
127
+
docker run -d -p 8080:8080 <YOUR_DOCKER_USERNAME>/docker-quickstart
128
+
```
137
129
138
-
You can verify if the container is working by visiting [http://localhost:8080](http://localhost:8080) with your browser.
130
+
You can verify if the container is working by visiting [http://localhost:8080](http://localhost:8080) with your browser.
139
131
140
-
6. Use the [`docker tag`](/reference/cli/docker/image/tag/) command to tag the Docker image. Docker tags allow you to label and version your images.
132
+
6. Use the [`docker tag`](/reference/cli/docker/image/tag/) command to tag the Docker image. Docker tags allow you to label and version your images.
141
133
142
-
```console
143
-
docker tag <YOUR_DOCKER_USERNAME>/docker-quickstart <YOUR_DOCKER_USERNAME>/docker-quickstart:1.0
144
-
```
134
+
```console
135
+
docker tag <YOUR_DOCKER_USERNAME>/docker-quickstart <YOUR_DOCKER_USERNAME>/docker-quickstart:1.0
136
+
```
145
137
146
138
7. Finally, it's time to push the newly built image to your Docker Hub repository by using the [`docker push`](/reference/cli/docker/image/push/) command:
8. Open [Docker Hub](https://hub.docker.com) and navigate to your repository. Navigate to the **Tags** section and see your newly pushed image.
153
145
154
-

146
+

155
147
156
148
In this walkthrough, you signed up for a Docker account, created your first Docker Hub repository, and built, tagged, and pushed a container image to your Docker Hub repository.
0 commit comments