vault backup: 2026-11-07 16:33:44
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
Podman是一个开源的容器管理工具,语法兼容 Docker,但是某些方面比原生 Docker 命令更好用,比如能够以非root用户的身份去运行容器,而且不需要守护进程。
|
||||
|
||||
Podman引入了一个注册表的概念,注册表就是包括 [docker.io](http://docker.io/) 在内的多个容器镜像源,默认的有 redhat docker fedora centos quay。
|
||||
|
||||
国内直接用 podman pull 拉取镜像会很慢,所以需要配置国内镜像源来加速访问。国内的镜像源有以下:
|
||||
|
||||
- docker官方中国区: https://registry.docker-cn.com
|
||||
- 网易: http://hub-mirror.c.163.com
|
||||
- USTC: http://docker.mirrors.ustc.edu.cn
|
||||
- 阿里云: http://<你的ID>.mirror.aliyuncs.com
|
||||
|
||||
|
||||
|
||||
#### 1.修改Podman的注册表配置文件
|
||||
|
||||
```vim /etc/containers/registries.conf
|
||||
|
||||
|
||||
unqualified-search-registries = ["docker.io"]
|
||||
|
||||
|
||||
[[registry]]
|
||||
prefix = "docker.io"
|
||||
location="d1234.mirror.aliyuncs.com"
|
||||
```
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
注:此处location的值只需要填写 https:// 之后的内容就行了
|
||||
|
||||
#### 3.测试是否可以拉取对应的镜像
|
||||
|
||||
podman pull hello-world
|
||||
|
||||
|
||||

|
||||
|
||||
**注意:由于podman目前还不是很完善,好些镜像还是无法下载到(可以通过docker下载完镜像后导入到podman安装的那台机器上也是可以正常使用的)**
|
||||
Reference in New Issue
Block a user