点击上方蓝色“3分钟云计算”关注我们,设个星标,每天学习云计算知识
Linus 最聪明和最有价值的成就其实不是构建出一个Linux内核,而是他发明的这种Linux开发模式 - 《大教堂与集市》
在解决这个问题的过程中,突然意识到了开源的力量,遂记录在此(碎碎念)。
这周二, 我使用Podman build image 的时候遇到空间不足的问题,
jiazha-mac:~ jiazha$ podman build -t quay.io/olmqe/etcd-index:fips -f catalog.Dockerfile
Error: mkdir /var/tmp/libpod_builder3448793565: no space left on device
很迷惑, 然后就开始去检查 Machine 的启动日志、空间剩余等, 看起来都没有什么问题。一时比较抓狂,无奈之下给Podman社区开了个Issue, 感兴趣的可以去看 https://github.com/containers/podman/issues/23287
jiazha-mac:~ jiazha$ podman machine list
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* applehv About a minute ago Currently running 5 2GiB 50GiB
jiazha-mac:~ jiazha$ podman machine ssh
...
core@localhost:~$ journalctl -p err
Jul 16 17:33:39 localhost systemd[1]: /etc/systemd/system/var-folders.automount:2: Where= path is not absolute, ignoring: a0bb3a2c8b0b02ba5958b0576f0d6530e104
Jul 16 17:33:39 localhost systemd[1]: /etc/systemd/system/private.automount:2: Where= path is not absolute, ignoring: 71708eb255bc230cd7c91dd26f7667a7b938
Jul 16 17:33:39 localhost systemd[1]: /etc/systemd/system/Users.automount:2: Where= path is not absolute, ignoring: a2a0ee2c717462feb1de2f5afd59de5fd2d8
Jul 16 17:33:40 localhost systemd-tmpfiles[1599]: "/home" already exists and is not a directory.
Jul 16 17:33:40 localhost systemd-tmpfiles[1599]: "/srv" already exists and is not a directory.
Jul 16 17:33:40 localhost systemd-tmpfiles[1599]: "/root" already exists and is not a directory.
Jul 16 17:33:41 localhost.localdomain systemd[1]: /etc/systemd/system/var-folders.automount:2: Where= path is not absolute, ignoring: a0bb3a2c8b0b02ba5958b0576f0d6530e104
Jul 16 17:33:41 localhost.localdomain systemd[1]: /etc/systemd/system/private.automount:2: Where= path is not absolute, ignoring: 71708eb255bc230cd7c91dd26f7667a7b938
Jul 16 17:33:41 localhost.localdomain systemd[1]: /etc/systemd/system/Users.automount:2: Where= path is not absolute, ignoring: a2a0ee2c717462feb1de2f5afd59de5fd2d8
core@localhost:~$ df -h /var/tmp/
Filesystem Size Used Avail Use% Mounted on
/dev/vda4 50G 3.3G 47G 7% /var
Podman 项目成员 Paul Holzinger 回了一句 How big is your context dir? The full context dir must be copied into the VM on build.
一语惊醒梦中人!我突然意识到问题就出在这里,因为我的Dockerfile 是在家目录下的,而且我的家目录占用的空间很大。之后,我把Dockerfile 移动到一个文件夹下,重新build 就没这个问题了。
问题解决了,但是我觉得podman的这个行为不够友好(我想大多Podman 用户也没有意识到这个行为),为什么Podman build image 的时候要把整个上下文目录复制到 VM 中呢
所以我添加了comments 表达了我的疑虑。
让人高兴的是Podman 成员创建了一个增强PR(https://github.com/containers/podman/pull/23321) 来提醒用户这个行为。你看,这不就是开源的正反馈吗。用户免费使用Podman,遇到问题,反馈给社区,然后社区修复提高Podman, 一起参与把产品做的更好!
我在想为什么一个开源的产品要比闭源的更好呢,那是因为使用(测试)开源产品的人远比测试闭源产品的人多的多!测试闭源产品的人局限在一个公司内部,最多也就几十人,然而测试开源产品的人成千上万,而且来自世界各地,不同的文化,不同的使用场景,不同的视角,
只要“眼睛多, bug 容易捉” ,这大概就是开源的力量吧。开源势不可挡!
END