From c8af029948cb4ac5c8fdf9b288e085dd48446bbf Mon Sep 17 00:00:00 2001 From: Elbek Azimov Date: Sat, 10 Oct 2015 23:28:50 +0500 Subject: [PATCH] fix: move hosts file inside the docker container #136 --- lib/vagrant-hostmanager/hosts_file/updater.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vagrant-hostmanager/hosts_file/updater.rb b/lib/vagrant-hostmanager/hosts_file/updater.rb index a82e37d..9514508 100644 --- a/lib/vagrant-hostmanager/hosts_file/updater.rb +++ b/lib/vagrant-hostmanager/hosts_file/updater.rb @@ -38,6 +38,8 @@ module VagrantPlugins machine.communicate.upload(file, '/tmp/hosts') if windir machine.communicate.sudo("#{move_cmd} /tmp/hosts/hosts.#{machine.name} #{realhostfile}") + elsif machine.communicate.test('test -f /.dockerinit') + machine.communicate.sudo("cat /tmp/hosts > #{realhostfile}") else machine.communicate.sudo("#{move_cmd} /tmp/hosts #{realhostfile}") end