Search code examples
podmanbuildah

How to run podman and buildah without writing to home directory?


There is almost no disk space left in my home directory but I have a lot of disk space in the directory /scratch/tmpexperiment. That directory is now empty.

I would like to try out the commands podman and buildah (just to experiment and learn). After the experiment I would like to erase the directory /scratch/tmpexperiment.

Is it possible to instruct podman and buildah to only create and write files under /scratch/tmpexperiment?

Preferably my home directory should remain untouched during the experiment (or at least modified as little as possible).

My user does not have sudo permissions. This question is regarding non-root (rootless) use of podman and buildah. The installed software versions are podman 1.4.0 and 1.9.0-dev.


Solution

  • Two ways to do this. One would be to bind mount a directory fro /stratch/tmpexperiment on ~/.local/share/containers.

    Second would be to run

    podman info, then edit ~/.config/containers/storage.conf

    And modify graphroot option

    graphroot = "/home/dwalsh/.local/share/containers/storage"

    To something like

    graphroot = /stratch/tmpexperiment/containers/storage