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
Copy file name to clipboardExpand all lines: content/en/docs/tasks/configure-pod-container/pull-image-private-registry.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,10 @@ weight: 100
7
7
<!-- overview -->
8
8
9
9
This page shows how to create a Pod that uses a
10
-
{{< glossary_tooltip text="Secret" term_id="secret" >}} to pull an image from a
11
-
private container image registry or repository.
10
+
{{< glossary_tooltip text="Secret" term_id="secret" >}} to pull an image
11
+
from a private container image registry or repository. There are many private
12
+
registries in use. This task uses [Docker Hub](https://www.docker.com/products/docker-hub)
13
+
as an example registry.
12
14
13
15
{{% thirdparty-content single="true" %}}
14
16
@@ -18,6 +20,8 @@ private container image registry or repository.
18
20
19
21
* To do this exercise, you need the `docker` command line tool, and a
20
22
[Docker ID](https://docs.docker.com/docker-id/) for which you know the password.
23
+
* If you are using a different private container registry, you need the command
24
+
line tool for that registry and any login information for the registry.
21
25
22
26
<!-- steps -->
23
27
@@ -59,12 +63,13 @@ The output contains a section similar to this:
59
63
If you use a Docker credentials store, you won't see that `auth` entry but a `credsStore` entry with the name of the store as value.
60
64
{{< /note >}}
61
65
62
-
## Create a Secret based on existing Docker credentials {#registry-secret-existing-credentials}
66
+
## Create a Secret based on existing credentials {#registry-secret-existing-credentials}
63
67
64
68
A Kubernetes cluster uses the Secret of `kubernetes.io/dockerconfigjson` type to authenticate with
65
69
a container registry to pull a private image.
66
70
67
-
If you already ran `docker login`, you can copy that credential into Kubernetes:
71
+
If you already ran `docker login`, you can copy
72
+
that credential into Kubernetes:
68
73
69
74
```shell
70
75
kubectl create secret generic regcred \
@@ -77,7 +82,7 @@ secret) then you can customise the Secret before storing it.
77
82
Be sure to:
78
83
79
84
- set the name of the data item to `.dockerconfigjson`
80
-
- base64 encode the docker file and paste that string, unbroken
85
+
- base64 encode the Docker configuration file and then paste that string, unbroken
81
86
as the value for field `data[".dockerconfigjson"]`
82
87
- set `type` to `kubernetes.io/dockerconfigjson`
83
88
@@ -213,4 +218,3 @@ kubectl get pod private-reg
213
218
* Learn more about [adding image pull secrets to a service account](/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account).
214
219
* See [kubectl create secret docker-registry](/docs/reference/generated/kubectl/kubectl-commands/#-em-secret-docker-registry-em-).
215
220
* See the `imagePullSecrets` field within the [container definitions](/docs/reference/kubernetes-api/workload-resources/pod-v1/#containers) of a Pod
0 commit comments