gpt4 book ai didi

vagrant - 在 vagrant up 上向主机添加/etc/hosts 条目

转载 作者:行者123 更新时间:2023-12-02 06:30:57 27 4
gpt4 key购买 nike

vagrant up 过程中是否可以修改主机上的文件?例如,向主机的 /etc/hosts 文件添加一个条目以避免手动执行此操作?

最佳答案

解决方案是使用 vagrant-hostsupdater

vagrant plugin install vagrant-hostsupdater

This plugin adds an entry to your /etc/hosts file on the host system.

On up and reload commands, it tries to add the information, if its not already existant in your hosts file. If it needs to be added, you will be asked for an administrator password, since it uses sudo to edit the file.

On halt, suspend and destroy, those entries will be removed again.

关于vagrant - 在 vagrant up 上向主机添加/etc/hosts 条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16624905/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com