Buildah - 一个有助于构建Open Container Initiative(OCI)容器映像的工具

Buildah软件包提供了一个可用于的命令行工具
建立一个工做容器,从头开始或使用 image做为起点
从工做容器或Dockerfile中的指令建立 image
image能够采用OCI image格式或传统的上upstream image格式构建
挂载工做容器的根文件系统以进行操做
卸载工做容器的根文件系统
使用容器的根文件系统的更新内容做为文件系统层来建立新image
删除工做容器或image
重命名本地容器

适用于开发人员的Buildah信息git

有关博客,发布公告等信息,请访问buildah.io网站!github

Buildah Demosgolang

Changelogdocker

Contributingbash

Development Planapp

Installation noteside

Troubleshooting Guide工具

Tutorials网站

Buildah和Podman的关系
Buildah和Podman是两个互补的开源项目,可在大多数Linux平台上使用,这两个项目都驻留在GitHub.com,Buildah在这里,Podman在这里。 Buildah和Podman都是用于Open Container Initiative(OCI)图像和容器的命令行工具。这两个项目的专业化差别很大。
Buildah专一于构建OCI图像。 Buildah的命令复制Dockerfile中的全部命令。这容许使用和不使用Dockerfiles构建图像,同时不须要任何root权限。 Buildah的最终目标是提供更低级别的coreutils界面来构建图像。在没有Dockerfiles的状况下构建映像的灵活性容许将其余脚本语言集成到构建过程当中。 Buildah遵循一个简单的fork-exec模型,并不做为守护进程运行,但它基于golang中的综合API,能够存储到其余工具中。
Podman专一于帮助您维护和修改OCI图像的全部命令和功能,例如拉动和标记。它还容许您建立,运行和维护从这些图像建立的容器。
Podman和Buildah之间的一个主要区别是他们的容器概念。 Podman容许用户建立“传统容器”,其中这些容器的意图是长寿的。虽然Buildah容器实际上只是为了容许将内容添加回容器图像而建立的。想到它的一种简单方法是buildah run命令模拟Dockerfile中的RUN命令,而podman run命令模拟功能中的docker run命令。因为这一点及其底层存储差别,您没法在Buildah中看到Podman容器,反之亦然。
Example
From ./examples/lighttpd.sh:
$ cat > lighttpd.sh <<"EOF"
#!/bin/bash -x
ctr1=$(buildah from "${1:-fedora}")
## Get all updates and install our minimal httpd server
buildah run "$ctr1" -- dnf update -y
buildah run "$ctr1" -- dnf install -y lighttpd
## Include some buildtime annotations
buildah config --annotation "com.example.build.host=$(uname -n)" "$ctr1"
## Run our server and expose the port
buildah config --cmd "/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf" "$ctr1"
buildah config --port 80 "$ctr1"
## Commit this container to an image name
buildah commit "$ctr1" "${2:-$USER/lighttpd}"
EOF
$ chmod +x lighttpd.sh
$ sudo ./lighttpd.sh
简而言之,Buildah是建立OCI图像的有效方式,而Podman容许您使用熟悉的容器cli命令在生产环境中管理和维护这些图像和容器。有关详细信息,请参阅“容器工具指南”。

 命令:ui

Command Description
buildah-add(1) Add the contents of a file, URL, or a directory to the container.
buildah-bud(1) Build an image using instructions from Dockerfiles.
buildah-commit(1) Create an image from a working container.
buildah-config(1) Update image configuration settings.
buildah-containers(1) List the working containers and their base images.
buildah-copy(1) Copies the contents of a file, URL, or directory into a container's working directory.
buildah-from(1) Creates a new working container, either from scratch or using a specified image as a starting point.
buildah-images(1) List images in local storage.
buildah-info(1) Display Buildah system information.
buildah-inspect(1) Inspects the configuration of a container or image.
buildah-mount(1) Mount the working container's root filesystem.
buildah-pull(1) Pull an image from the specified location.
buildah-push(1) Push an image from local storage to elsewhere.
buildah-rename(1) Rename a local container.
buildah-rm(1) Removes one or more working containers.
buildah-rmi(1) Removes one or more images.
buildah-run(1) Run a command inside of the container.
buildah-tag(1) Add an additional name to a local image.
buildah-umount(1) Unmount a working container's root file system.
buildah-unshare(1) Launch a command in a user namespace with modified ID mappings.
buildah-version(1) Display the Buildah Version Information
相关文章
相关标签/搜索