Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

3.2. podman 管理

3.2.1. 虚拟机管理

			
$ podman machine init	# 初始化
$ podman machine start	# 启动 podman VM
$ podman machine stop	# 停止VM
$ podman machine list	# 罗列VM
$ podman machine rm		# 删除VM
$ podman machine ssh	# 通过SSH 进入VM,在终端进行操作
			
		

3.2.1.1. 管理 Podman 系统

			
$ podman system --help
    
neo@MacBook-Pro-Neo ~> podman system connection list
Name                         URI                                                         Identity                                Default
podman-machine-default       ssh://core@localhost:59590/run/user/501/podman/podman.sock  /Users/neo/.ssh/podman-machine-default  true
podman-machine-default-root  ssh://root@localhost:59590/run/podman/podman.sock           /Users/neo/.ssh/podman-machine-default  false

$ podman system df
    TYPE           TOTAL       ACTIVE      SIZE        RECLAIMABLE
    Images         29          0           8.931GB     8.931GB (100%)
    Containers     0           0           0B          0B (0%)
    Local Volumes  1           0           0B          0B (0%)
    
$ podman system info	
			
			

3.2.2. 镜像管理

3.2.2.1. 获取镜像

			 
[root@localhost ~]# podman pull busybox
Resolved "busybox" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/busybox:latest...
Getting image source signatures
Copying blob 45a0cdc5c8d3 done  
Copying config 334e4a014c done  
Writing manifest to image destination
Storing signatures
334e4a014c81bd4050daa78c7dfd2ae87855e9052721c164ea9d9d9a416ebdd3		
			
			

3.2.2.2. 查看镜像

			 
[root@localhost ~]# podman image ls
REPOSITORY                 TAG         IMAGE ID      CREATED      SIZE
docker.io/library/busybox  latest      334e4a014c81  13 days ago  5.09 MB		
			
			

3.2.3. Registry

		 
mkdir -p /var/lib/registry
podman run --privileged -d --name registry -p 5000:5000 -v /var/lib/registry:/var/lib/registry --restart=always registry:2		
		
		

修改 /etc/containers/registries.conf 配置文件

		 
registries = []
改为
registries = ['localhost:5000']