buildah-mount(1)
π buildah-mount(1) β it's a General Commands Manual, bestie π
Okay so this is the manual for buildah-mount(1), and we're about to dive into mounting container root filesystems. It's giving utility, it's giving access, and honestly? Obsessed. β¨
πΈ NAME πΈ
buildah-mount β Mounts a working container's root filesystem. No cap, that's the whole vibe. π
π SYNOPSIS π
buildah mount [container ...]
π¦ DESCRIPTION π¦
Okay so here's the tea: this command mounts the specified container's root file system to a location that you can access from the host, and then it returns that location. It's literally giving you the keys to the filesystem kingdom. π
If you invoke the mount command without any arguments, the tool will list all of the currently mounted containers. It's like a little roll call for your mounts. πβ¨
Rootless mode alert! π¨ When running in rootless mode,mountruns in a different namespace so that the mounted volume might not be accessible from the host when using a driver different thanvfs. To be able to access the mounted file system, you might need to create the mount namespace separately as part ofbuildah unshare. In the environment created withbuildah unshareyou can then usebuildah mountand have access to the mounted file system. It's a whole thing, but we got you. π
β RETURN VALUE β
The location of the mounted file system. On error an empty string and errno is returned. So if it's empty, you know something went sideways. π
π OPTIONS π
--jsonβ Output in JSON format. For all my structured-data besties out there. π
π₯ EXAMPLE π₯
First up, mounting a single container:
buildah mount working-container
/var/lib/containers/storage/overlay2/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged
Then just buildah mount with no args to see what's already mounted:
buildah mount
working-container /var/lib/containers/storage/overlay2/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged
fedora-working-container /var/lib/containers/storage/overlay2/0ff7d7ca68bed1ace424f9df154d2dd7b5a125c19d887f17653cbcd5b6e30ba1/merged
And you can mount multiple containers at once, like the multitasking icon you are:
buildah mount working-container fedora-working-container ubi8-working-container
working-container /var/lib/containers/storage/overlay/f8cac5cce73e5102ab321cc5b57c0824035b5cb82b6822e3c86ebaff69fefa9c/merged
fedora-working-container /var/lib/containers/storage/overlay/c3ec418be5bda5b72dca74c4d397e05829fe62ecd577dd7518b5f7fc1ca5f491/merged
ubi8-working-container /var/lib/containers/storage/overlay/03a071f206f70f4fcae5379bd5126be86b5352dc2a0c3449cd6fca01b77ea868/merged
If running in rootless mode, you need to do a buildah unshare first to use the mount point. Here's the whole flow:
$ buildah unshare
# buildah mount working-container
/var/lib/containers/storage/overlay/f8cac5cce73e5102ab321cc5b57c0824035b5cb82b6822e3c86ebaff69fefa9c/merged
# cp foobar /var/lib/containers/storage/overlay/f8cac5cce73e5102ab321cc5b57c0824035b5cb82b6822e3c86ebaff69fefa9c/merged
# buildah unmount working-container
# exit
$ buildah commit working-container newimage
π SEE ALSO π
Check out buildah(1), buildah-umount(1), and buildah-unshare(1) β they're all part of the squad. π«Ά
That's the tea, bestie! π This page is from buildah, March 2017 edition. Now go slay those container mounts! πβ¨
π¦ where this page comes from
- centos-stream 10: buildah 2:1.45.0-2.el10 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms