【问题标题】:How to run podman and buildah without writing to home directory?如何在不写入主目录的情况下运行 podman 和 buildah?
【发布时间】:2019-10-29 17:38:56
【问题描述】:

我的主目录中几乎没有剩余磁盘空间,但是 我在目录 /scratch/tmpexperiment 中有很多磁盘空间。该目录现在是空的。

我想试试podmanbuildah 命令(只是为了实验和学习)。实验结束后我想擦除目录/scratch/tmpexperiment

是否可以指示podmanbuildah 只在/scratch/tmpexperiment 下创建和写入文件

我的主目录最好在实验期间保持不变(或至少尽可能少修改)。

我的用户没有 sudo 权限。这个问题是关于 podman 和 buildah 的非根(无根)使用。安装的软件版本为 podman 1.4.0 和 1.9.0-dev。

【问题讨论】:

  • 只是猜测:也许设置一些环境变量?

标签: podman buildah


【解决方案1】:

有两种方法可以做到这一点。一种方法是在 ~/.local/share/containers 上绑定从 /stratch/tmpexperiment 挂载的目录。

第二个是运行

播客信息, 然后编辑 ~/.config/containers/storage.conf

并修改graphroot选项

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

类似

graphroot = /stratch/tmpexperiment/containers/storage

【讨论】:

  • 在 Ubuntu 19.04 上:mount -o bind /stratch/tmpexperiment ~/.local/share/containers 失败并出现 mount: only root can use "--options" option 。我的用户没有 sudo 权限。但看起来第二种方法可行。
猜你喜欢
  • 2021-04-28
  • 2020-07-18
  • 2016-09-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多