我正在使用multipass来设置一个Ubuntu虚拟机映像。我想让apt包的安装成为可重复的。有没有可能以某种方式编写脚本?
发布于 2020-12-29 17:46:48
您可以创建cloud-config文件,并在启动新的VM时通过--cloud-init选项添加它。Cloud init允许您在几乎任何云提供商上配置VM,它是一个非常通用的工具。这样你就可以添加任何你想要的包,创建新闻用户,运行bash命令等等。有关云配置文件here的更多信息。
然后使用以下命令运行cloud-config文件:
multipass launch -n your_vm_name --cloud-init path/to/cloudconfig/file.yamlhttps://stackoverflow.com/questions/62994161
复制相似问题