通过毫秒镜像提供的镜像加速,见https://mdoc.cc/mliev/1ms/v1.0.0/18,如下:

[root@localhost ~]# cd /etc/containers/
certs.d/           oci/               registries.conf.d/ registries.d/      systemd/           
[root@localhost ~]# cd /etc/containers/registries.conf.d
[root@localhost registries.conf.d]# ll
total 472
-rw-r--r--. 1 root root   6387 Mar 18 00:34 000-shortnames.conf
-rw-r--r--. 1 root root 463829 Mar 18 00:34 001-rhel-shortnames.conf
-rw-r--r--. 1 root root    497 Mar 18 00:34 002-rhel-shortnames-overrides.conf
-rw-r--r--. 1 root root    264 May 17 14:15 custom.conf
[root@localhost registries.conf.d]# vim custom.conf
[root@localhost registries.conf.d]# cat custom.conf
unqualified-search-registries = ["docker.io","ghcr.io"]

[[registry]]
prefix = "docker.io"
location = "docker.io"

[[registry.mirror]]
location = "docker.1ms.run"

[[registry]]
prefix = "ghcr.io"
location = "ghcr.io"

[[registry.mirror]]
location = "ghcr.1ms.run"
[root@localhost registries.conf.d]# podman pull nginx
Trying to pull docker.io/library/nginx:latest...
Getting image source signatures
Copying blob 030365c1a354 skipped: already exists  
Copying blob 834a05acfff4 skipped: already exists  
Copying blob 735e1c628373 skipped: already exists  
Copying blob 57fb71246055 skipped: already exists  
Copying blob 60ad0c2ccfc6 skipped: already exists  
Copying blob 1bb34ee717a4 skipped: already exists  
Copying blob 9f7bde970101 skipped: already exists  
Copying config 6f8edba05e done   | 
Writing manifest to image destination
6f8edba05e380a2dcd013045301ccc3485623f8e09d1faf34d30376eec576889
[root@localhost registries.conf.d]# 
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐