Easiest way to copy a single file from host to Vagrant guest?

前端 未结 19 1770
暖寄归人
暖寄归人 2020-12-22 15:15

I have a use case where I occasionally want to copy a single file from my host machine to the Vagrant guest.

I don\'t want to do so via traditional provisioners (Pup

19条回答
  •  悲哀的现实
    2020-12-22 15:20

    All the above answers might work. But Below is what worked for me. I had multiple vagrant host: host1, host2. I wanted to copy file from ~/Desktop/file.sh to host: host1 I did:

        $vagrant upload ~/Desktop/file.sh host1
    

    This will copy ~/Desktop/file.sh under /home/xxxx where xxx is your vagrant user under host1

提交回复
热议问题