Difference between revisions of "Buildah"

From John Freier
Jump to: navigation, search
Line 8: Line 8:
  
 
Push image to a local file as oci format
 
Push image to a local file as oci format
 +
  -- got working
 +
  buildah push --format oci localhost/cs:latest  oci-archive:/app/target/cs-oci.tar
 +
 
 +
  -- did not get working
 
   buildah push --format docker localhost/cs:latest  oci-archive:/app/target/cs-image.tar
 
   buildah push --format docker localhost/cs:latest  oci-archive:/app/target/cs-image.tar
 +
  
  

Revision as of 11:21, 6 April 2022

This tool is used to build images.

Build an image

 buildah bud -t {image}:{tag}

List all images

 buildah images

Push image to a local file as oci format

 -- got working
 buildah push --format oci localhost/cs:latest  oci-archive:/app/target/cs-oci.tar
 
 -- did not get working
 buildah push --format docker localhost/cs:latest  oci-archive:/app/target/cs-image.tar


To run buildah using docker

 docker run -it \
   --security-opt seccomp=unconfined \
   --security-opt apparmor=unconfined \
   --device /dev/fuse \
   --entrypoint "/bin/bash" \
   quay.io/buildah/stable

You need to have the following flags

 --security-opt seccomp=unconfined
 --security-opt apparmor=unconfined
 --device /dev/fuse

seccomp - Docker restricts using unshare system call inside a containers.

apparmor - This flag is required.

/dev/fuse - This is needed to use the fuse-overlay program inside the container rather then using the host kernel overlay.