Building Container Image using buildah


  • The Buildah package provides a command line tool that can be used to
  • Create a working container, either from scratch or using an image as a starting point
  • Create an image, either from a working container or via the instructions in a Dockerfile
  • Images can be built in either the OCI image format or the traditional upstream Docker image format
  • Mount a working container's root file system for manipulation
  • Unmount a working container's root file system
  • Use the updated contents of a container's root file system as a file system layer to create a new image
  • Delete a working container or an image
  • Rename a local container

buildah from centos
buildah images
buildah containers
curl -sSL https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz -o hello-2.10.tar.gz
buildah copy centos-working-container hello-2.10.tar.gz /tmp/ 
buildah run centos-working-container yum install -y tar gcc make 
buildah run centos-working-container yum clean all
buildah run centos-working-container tar xvzf /tmp/hello-2.10.tar.gz -C /opt
buildah config --workingdir /opt/hello-2.10 centos-working-container
buildah run centos-working-container ./configure
buildah run centos-working-container make
buildah run centos-working-container make install
buildah run centos-working-container hello –v
buildah config --entrypoint /usr/local/bin/hello centos-working-container
buildah commit --format docker centos-working-container firstbuildah:latest
buildah images
podman save -o mybuild1.tar localhost/hello2latest
podman rmi 638d3f915ea2 –f
podman load -i mybuild1.tar



No comments:

Post a Comment