@@ -5,10 +5,16 @@ This document describes the method to configure the image registry for `containe
5
5
> ** _ NOTE:_ ** registry.mirrors and registry.configs as previously described in this document
6
6
> have been DEPRECATED. As described in [ the cri config] ( ./config.md#registry-configuration ) you
7
7
> should now use the following configuration
8
+ + Before containerd 2.0
8
9
``` toml
9
10
[plugins ."io .containerd .grpc .v1 .cri" .registry ]
10
11
config_path = " /etc/containerd/certs.d"
11
12
```
13
+ + In containerd 2.0
14
+ ``` toml
15
+ [plugins ."io .containerd .cri .v1 .images" .registry ]
16
+ config_path = " /etc/containerd/certs.d"
17
+ ```
12
18
13
19
## Configure Registry Credentials
14
20
@@ -20,6 +26,7 @@ This document describes the method to configure the image registry for `containe
20
26
To configure a credential for a specific registry, create/modify the
21
27
` /etc/containerd/config.toml ` as follows:
22
28
29
+ + Before containerd 2.0
23
30
``` toml
24
31
# explicitly use v2 config format
25
32
version = 2
@@ -32,6 +39,19 @@ version = 2
32
39
auth = " "
33
40
identitytoken = " "
34
41
```
42
+ + In containerd 2.0
43
+ ``` toml
44
+ # explicitly use v3 config format
45
+ version = 3
46
+
47
+ # The registry host has to be a domain name or IP. Port number is also
48
+ # needed if the default HTTPS or HTTP port is not used.
49
+ [plugins ."io .containerd .cri .v1 .images" .registry .configs ."gcr .io" .auth ]
50
+ username = " "
51
+ password = " "
52
+ auth = " "
53
+ identitytoken = " "
54
+ ```
35
55
36
56
The meaning of each field is the same with the corresponding field in ` .docker/config.json ` .
37
57
@@ -75,7 +95,7 @@ Now that you know you can access your GCR from your terminal, it is now time to
75
95
Edit the containerd config (default location is at ` /etc/containerd/config.toml ` )
76
96
to add your JSON key for ` gcr.io ` domain image pull
77
97
requests:
78
-
98
+ + Before containerd 2.0
79
99
``` toml
80
100
version = 2
81
101
@@ -90,6 +110,21 @@ version = 2
90
110
username = " _json_key"
91
111
password = ' paste output from jq'
92
112
```
113
+ + In containerd 2.0
114
+ ``` toml
115
+ version = 3
116
+
117
+ [plugins ."io .containerd .cri .v1 .images" .registry ]
118
+ [plugins ."io .containerd .cri .v1 .images" .registry .mirrors ]
119
+ [plugins ."io .containerd .cri .v1 .images" .registry .mirrors ."docker .io" ]
120
+ endpoint = [" https://registry-1.docker.io" ]
121
+ [plugins ."io .containerd .cri .v1 .images" .registry .mirrors ."gcr .io" ]
122
+ endpoint = [" https://gcr.io" ]
123
+ [plugins ."io .containerd .cri .v1 .images" .registry .configs ]
124
+ [plugins ."io .containerd .cri .v1 .images" .registry .configs ."gcr .io" .auth ]
125
+ username = " _json_key"
126
+ password = ' paste output from jq'
127
+ ```
93
128
94
129
> Note: ` username ` of ` _json_key ` signifies that JSON key authentication will be used.
95
130
0 commit comments