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
相關文章
相關標籤/搜索