Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
f30_buildah [2019/04/03 03:53] – [Basics] rpjdayf30_buildah [2019/04/03 08:23] (current) – [Basics] rpjday
Line 12: Line 12:
  
 ===== Basics ===== ===== Basics =====
 +
 +''buildah'' sits on top of:
 +
 +  * OCI containers/image project (copy, push, pull, inspect images)
 +  * OCI containers/storage project (store FS layers, images and containers)
  
 ''buildah'' can build images from any of: ''buildah'' can build images from any of:
Line 44: Line 49:
   unshare                Run a command in a modified user namespace   unshare                Run a command in a modified user namespace
   version                Display the Buildah version information   version                Display the Buildah version information
 +</code>
 +
 +===== Build container from existing image =====
 +
 +Delete all existing containers and check:
 +
 <code> <code>
 +$ buildah rm --all
 +$ buildah containers
 +CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
 +$
 +</code>
  
 +Build from Fedora image and verify:
  
 +<code>
 +$ fc=$(buildah from fedora)
 +$ echo ${fc}
 +fedora-working-container
 +$
 +</code>
 +
 +Run:
 +
 +<code>
 +$ buildah run $fc bash
 +#
 +</code>
 +
 +===== Running command in container =====
 +
 +<code>
 +$ buildah run ${fc} cat /etc/os-release
 +</code>
 +===== Building containers from scratch =====
 +
 +<code>
 +$ sc=$(buildah from scratch)
 +$ buildah containers
 +CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
 +6935a1961a34         d09302f77cfc docker.io/library/fedora:latest  fedora-working-container
 +4dd92fc19b8a                      scratch                          working-container
 +$
 +</code>
  • f30_buildah.1554263612.txt.gz
  • Last modified: 2019/04/03 03:53
  • by rpjday