Figured it out. There are at least two solutions.
privileged set to falseIn Vagrantfile, change this line...
config.vm.provision "shell", path: "./bootstrap.sh"
to this:
config.vm.provision "shell", path: "./bootstrap.sh", privileged: false
Vagrant will run as the vagrant user, not root (sudo).
/home/vagrant/.bash_aliasesChange...
if [ ! -f '~/.bash_aliases' ]; then
printf "# This is a comment." > ~/.bash_aliases ;
fi;
to this:
if [ ! -f /home/vagrant/.bash_aliases ]; then
printf "# This is a comment." > /home/vagrant/.bash_aliases ;
fi;
This writes directly to the vagrant user's directory.
I went with Solution 2.
برچسب:
نویسنده: استخدام کار