將單個文件從主機複製到 Vagrant 來賓的最簡單方法? - Easiest way to copy a single file from host to Vagrant guest?

問題:

I have a use case where I occasionally want to copy a single file from my host machine to the Vagrant guest.我有一個用例,我偶爾想將單個文件從我的主機複製到 Vagrant 來賓。

I don't want to do so via traditional provisioners (Puppet / Chef) because this is often a one-off -- I just want something quick to add to my Vagrantfile.我不想通過傳統的供應商(Puppet/Chef)這樣做,因爲這通常是一次性的——我只想快速添加一些東西到我的 Vagrantfile 中。

I don't want to share an entire directory, possibly because I want to overwrite an existing file without nuking an entire directory on the guest.我不想共享整個目錄,可能是因爲我想覆蓋現有文件而不破壞來賓上的整個目錄。

It also seems a bit overkill to write a shell provisioning script, and deal with potential escaping, when all I want to do is copy a file.當我只想複製一個文件時,編寫一個 shell 配置腳本並處理潛在的轉義似乎也有點過頭了。

So, what's the easiest way to copy a single file from host to guest?那麼,將單個文件從主機複製到來賓的最簡單方法是什麼?


解決方案:

參考一: https://stackoom.com/question/185UJ
參考二: Easiest way to copy a single file from host to Vagrant guest?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章