Run yum install pkg1 pkg2 -y &&\问题是,当我多次构建容器时,Docker看到这个命令没有改变,也从来没有运行过它。相反,它选择使用以前缓存的层。
但是,pkg1或pkg2可能已经在yum存储库中更新,需要更新,并且由于它使用缓存的docker层,因此容器不会接收更新的包。我可以使用--no-cache选项进行构建,但这会使所有缓存层失效,这会大大减慢容器构建的速度,因为我的yum ins
当试图在股票yum update 7 Docker容器中运行CentOS时,它在One of the configured repositories failed (Unknown)中失败:# yum updateDetermining fastestconfigured repositories failed (Unknown),Insufficient space i
/enable=1[root@localhost cdrom]# yum clean all safe thing yum can do is fail.Disable the repository, so yum won't use it by default.--enablerepo for temporary usage:
Ansible有yum模块, 我们可以使用它来安装一个包: ansible all -m yum -a 'name=vim state=latest' 但是如何使用它来执行clean和make我只知道脚本的方式: ansible all -m shell -a 'yum clean all'
ansible all -m shell -a 'yum makecache' 那么,如何使用yum模块来清理和缓存yum<