19.4. 使用 Buildah 获取镜像
使用 buildah from 命令从头开始创建新的工作容器,或者以指定的镜像作为起点。
先决条件
-
container-tools元数据包已安装。
流程
根据
registry.redhat.io/ubi9/ubi镜像,创建一个新的可正常工作的容器:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
列出本地存储中的所有镜像:
buildah images REPOSITORY TAG IMAGE ID CREATED SIZE registry.access.redhat.com/ubi9/ubi latest 272209ff0ae5 2 weeks ago 234 MB
# buildah images REPOSITORY TAG IMAGE ID CREATED SIZE registry.access.redhat.com/ubi9/ubi latest 272209ff0ae5 2 weeks ago 234 MBCopy to Clipboard Copied! Toggle word wrap Toggle overflow 列出工作容器及其基础镜像:
buildah containers CONTAINER ID BUILDER IMAGE ID IMAGE NAME CONTAINER NAME 01eab9588ae1 * 272209ff0ae5 registry.access.redhat.com/ub... ubi-working-container
# buildah containers CONTAINER ID BUILDER IMAGE ID IMAGE NAME CONTAINER NAME 01eab9588ae1 * 272209ff0ae5 registry.access.redhat.com/ub... ubi-working-containerCopy to Clipboard Copied! Toggle word wrap Toggle overflow