The old CRI config pattern for specifying registry.mirrors and registry.configs has been DEPRECATED. You should now point your registry to the path where your files are located.config_path``hosts.toml
Modify your (default location: ) as follows:config.toml``/etc/containerd/config.toml
$ ctr images pull registry.gfstack.geo:5555/memcached:20230808
INFO[0000] trying next host error="failed to do request: Head \"https://registry.gfstack.geo:5555/v2/memcached/manifests/20230808\": http: server gave HTTP response to HTTPS client"host="registry.gfstack.geo:5555"ctr: failed to resolve reference "registry.gfstack.geo:5555/memcached:20230808": failed to do request: Head "https://registry.gfstack.geo:5555/v2/memcached/manifests/20230808": http: server gave HTTP response to HTTPS client
必须带上配置路径参数才可以:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ ctr images pull --hosts-dir "/etc/containerd/certs.d" -k registry.gfstack.geo:5555/memcached:20230808
INFO[0000] host will try HTTPS first since it is configured for HTTP with a TLS configuration, consider changing host to HTTPS or removing unused TLS configuration host="registry.gfstack.geo:5555"INFO[0000] host will try HTTPS first since it is configured for HTTP with a TLS configuration, consider changing host to HTTPS or removing unused TLS configuration host="registry.gfstack.geo:5555"INFO[0000] host will try HTTPS first since it is configured for HTTP with a TLS configuration, consider changing host to HTTPS or removing unused TLS configuration host="registry.gfstack.geo:5555"INFO[0000] host will try HTTPS first since it is configured for HTTP with a TLS configuration, consider changing host to HTTPS or removing unused TLS configuration host="registry.gfstack.geo:5555"registry.gfstack.geo:5555/memcached:20230808: resolved |++++++++++++++++++++++++++++++++++++++|manifest-sha256:a378fc88e1cf862023111260e78e1b10fb0d60b8ad87fe7869a691b20e9dfb23: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:a8aa3384848b1da533a93fef8f83235205ba54e25477b0decc4dd2af37d79ee4: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:ec6231f619cff25219570cbe828d5aa2b0bd9cc8561ece4dbd6efd4d68c9a045: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:924900cefc78e2b86773a1c6b4f9f73246ec32dc26d72aaec5560a05a99d2e66: done|++++++++++++++++++++++++++++++++++++++|config-sha256:d53843c7e570e7c2fca82b193906e90dd053c8b8dc6485d10fd19b43de63e963: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:a1d0c75327776413fa0db9ed3adcdbadedc95a662eb1d360dad82bb913f8a1d1: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:2923d284c7b91601b2f866a733232190bcad0492c14b623be388abb3fab06c11: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:5ab10d3b8d744fd97ade43bac4190e1369785abc35d45e9e4f73827ed7d8ea50: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:392a6e5a5c6ef37cf0d35fb4974f18943e692db5534d565b39e4bdb2b9c6c8ce: done|++++++++++++++++++++++++++++++++++++++|layer-sha256:1d94b5844b27755d3a07b1a88e29344bdc874e83ab915849ab305aa7c213070a: done|++++++++++++++++++++++++++++++++++++++|elapsed: 0.1 s total: 0.0 B (0.0 B/s)unpacking linux/amd64 sha256:a378fc88e1cf862023111260e78e1b10fb0d60b8ad87fe7869a691b20e9dfb23...
done: 18.894916ms
ctr可能官方定位还是不是直接给人操作的,我发现crictl是可以直接拉取:
1
2
$ crictl pull registry.gfstack.geo:5555/memcached:20230808
Image is up to date for sha256:d53843c7e570e7c2fca82b193906e90dd053c8b8dc6485d10fd19b43de63e963