5.2. 在主机的容器中运行命令
使用 podman run 命令显示容器的操作系统的类型。
先决条件
-
container-tools模块已安装。
流程
使用
cat /etc/os-release命令,显示基于registry.access.redhat.com/ubi8/ubi容器镜像的容器的操作系统的类型:$ podman run --rm registry.access.redhat.com/ubi8/ubi cat /etc/os-release NAME="Red Hat Enterprise Linux" ... ID="rhel" ... HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT=" Red Hat Enterprise Linux 8" ...可选:列出所有容器。
$ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES由于
--rm选项,您应该看不到任何容器。容器已被删除。