buildah-containers(1)

πŸ“¦
version 1.45.0 Β· 5 versions
, in centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing

πŸ’– buildah-containers(1) πŸ’–

okay bestie, listen up β€” this is the manual page for buildah-containers, part of the buildah fam. it lives in the General Commands Manual section, and honestly? it's giving "let me just show you what's in my closet" energy. we're gonna get you fluent, no cap.


✨ NAME ✨

buildah-containers β€” list the working containers and their base images. that's it. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

buildah containers [options]

✨ DESCRIPTION ✨

okay so this one is SO straightforward and i love that for it. it lists containers which appear to be Buildah working containers, along with their names and IDs, and then β€” the bestie part β€” it also shows you the names and IDs of the images from which they were initialized. so you get the container AND its origin story. main character and backstory, periodt. πŸ¦‹


✨ OPTIONS ✨

  • --all, -a β€” list info about all containers, even the ones that were not created by Buildah and aren't being used by Buildah. how do you tell them apart? containers created by Buildah get an '*' in the 'BUILDER' column. cute lil star, iykyk ⭐
  • --filter, -f β€” filter the output based on conditions you provide. yes queen, narrow it down. πŸŽ€

here are the valid filters, pls memorize:

  • id β€” [ID] Container's ID
  • name β€” [Name] Container's name
  • ancestor β€” [ImageName] Image or descendant used to create container
  • --format β€” pretty-print containers using a Go template. so you can make it look exactly how you want it to look, obsessed. 🌸

valid placeholders for the Go template are listed below:

  • .ContainerID β€” Container ID
  • .Builder β€” Whether container was created by buildah
  • .ImageID β€” Image ID
  • .ImageName β€” Image name
  • .ContainerName β€” Container name
  • --json β€” output in JSON format. for the data girlies. πŸ”₯
  • --noheading, -n β€” omit the table headings from the listing of containers. bye bye headers πŸ‘‹
  • --notruncate β€” do not truncate IDs and image names in the output. no more lil ... cutting your faves off mid-name, we hate to see it. 😭
  • --quiet, -q β€” displays only the container IDs. minimal. clean. iconic. πŸ’…

✨ EXAMPLE ✨

okay bestie here's where it gets fun, watch:

buildah containers

CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
ccf84de04b80     *     53ce4390f2ad registry.access.redhat.com/ub... ubi8-working-container
45be1d806fc5     *     16ea53ea7c65 docker.io/library/busybox:latest busybox-working-container

see those lil stars in the BUILDER column? yeah. buildah babies. 🫢

now let's go quiet mode:

buildah containers --quiet

ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8
45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07

and stacking flags like the pro you are:

buildah containers -q --noheading --notruncate

ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8
45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07

json girlies rise up:

buildah containers --json

[
    {
        "id": "ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8",
        "builder": true,
        "imageid": "53ce4390f2adb1681eb1a90ec8b48c49c015e0a8d336c197637e7f65e365fa9e",
        "imagename": "registry.access.redhat.com/ubi8:latest",
        "containername": "ubi8-working-container"
    },
    {
        "id": "45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07",
        "builder": true,
        "imageid": "16ea53ea7c652456803632d67517b78a4f9075a10bfdc4fc6b7b4cbf2bc98497",
        "imagename": "docker.io/library/busybox:latest",
        "containername": "busybox-working-container"
    }
]

templates!! make it yours πŸ’–

buildah containers --format "{{.ContainerID}} {{.ContainerName}}"

ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8   ubi8-working-container
45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07   busybox-working-container

and if you want a lil label on it:

buildah containers --format "Container ID: {{.ContainerID}}"

Container   ID:   ccf84de04b80c309ce6586997c79a769033dc4129db903c1882bc24a058438b8
Container   ID:   45be1d806fc533fcfc2beee77e424d87e5990d3ce9214d6b374677d6630bba07

now filter by ancestor, chef's kiss:

buildah containers --filter ancestor=ubuntu

CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
fbfd3505376e     *     0ff04b2e7b63 docker.io/library/ubuntu:latest  ubuntu-working-container

✨ SEE ALSO ✨

  • buildah(1) β€” go read the parent page too, it's the whole ecosystem bestie 🌈

and that's the tea, bestie. this page comes from the buildah manual, dated March 2017 πŸŽ€ β€” yes she's been serving since 2017 and she has not missed a day. go list those containers, you got this. πŸ’œβœ¨

πŸ“¦ where this page comes from