名称¶
podman-system-migrate - 将现有容器迁移到新的 Podman 版本
简介¶
podman system migrate [选项]
描述¶
podman system migrate 将容器迁移到最新的 Podman 版本。
如果需要进行任何更改,podman system migrate 会负责将现有容器迁移到最新版本的 Podman。
“无根 Podman 使用一个暂停进程来保持非特权命名空间处于活动状态。这可以防止在暂停进程运行时,/etc/subuid
和 /etc/subgid
文件的任何更改传播到无根容器。
为了使这些更改生效,有必要首先停止与用户关联的所有正在运行的容器,并且停止暂停进程并删除其 pid 文件。与手动操作不同,可以使用 podman system migrate
来停止正在运行的容器和暂停进程。然后可以使用 usermod 编辑或更改 /etc/subuid
和 /etc/subgid
文件,以使用新配置的映射重新创建用户命名空间。
选项¶
--new-runtime=运行时¶
为所有容器设置新的 OCI 运行时。这可以在系统升级(更改了默认 OCI 运行时)后使用,以将所有容器移动到新的运行时。不能保证容器在新运行时下继续工作,因为某些运行时支持不同的选项和配置。
示例¶
正常调用
### No output is expected from this command.
$ podman system migrate
迁移到新的 OCI 运行时(例如,从 crun 到 runc)
### Create a container using the current default runtime (e.g., crun)
$ podman create --name test-alpine alpine
### Confirm the current runtime
$ podman container inspect test-alpine | grep OCIRuntime
"OCIRuntime": "crun",
### Migrate all containers to use a new runtime (e.g., runc)
$ podman system migrate --new-runtime runc
### Verify the container is now using the new runtime
$ podman container inspect test-alpine | grep OCIRuntime
"OCIRuntime": "runc",
另请参阅¶
podman(1), podman-system(1), usermod(8)
历史¶
2019 年 4 月,最初由 Giuseppe Scrivano (gscrivan at redhat dot com) 编写