Linux command
buildah 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Build
buildah build -t [myimage] [.]
Create
buildah from [fedora]
Run
buildah run [container-id] -- [dnf install -y httpd]
Copy
buildah copy [container-id] [local/path] [/container/path]
Commit
buildah commit [container-id] [myimage]
List
buildah images
Push
buildah push [myimage] [docker://registry.example.com/myimage:tag]
说明
buildah is a tool for building OCI and Docker container images without requiring a daemon. It provides fine-grained control over image layers and can build from Dockerfiles or through direct manipulation of containers. Unlike Docker, buildah does not require a background daemon process, making it well-suited for CI/CD pipelines and restricted environments. It supports rootless builds, where the entire build process runs without elevated privileges. As part of the Podman ecosystem, it shares storage and image formats with podman and skopeo, allowing seamless interoperation between the tools.
参数
- build (formerly bud)
- Build image using Containerfile/Dockerfile
- from _image_
- Create working container
- run _container_ _cmd_
- Run command in container
- commit _container_ _image_
- Save container as image
- push _image_ _destination_
- Push image to registry
- pull _image_
- Pull image from registry
- images
- List images
- containers
- List working containers
- copy _container_ _src_ _dest_
- Copy files into container
- config _options_ _container_
- Set image configuration (cmd, entrypoint, env, labels, etc.)
- rm _container_
- Remove container
- rmi _image_
- Remove image
- inspect _container|image_
- Display detailed information
- mount _container_
- Mount container filesystem
- umount _container_
- Unmount container filesystem
FAQ
What is the buildah command used for?
buildah is a tool for building OCI and Docker container images without requiring a daemon. It provides fine-grained control over image layers and can build from Dockerfiles or through direct manipulation of containers. Unlike Docker, buildah does not require a background daemon process, making it well-suited for CI/CD pipelines and restricted environments. It supports rootless builds, where the entire build process runs without elevated privileges. As part of the Podman ecosystem, it shares storage and image formats with podman and skopeo, allowing seamless interoperation between the tools.
How do I run a basic buildah example?
Run `buildah build -t [myimage] [.]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does build (formerly bud) do in buildah?
Build image using Containerfile/Dockerfile