Skip to content

Commit a5f69d8

Browse files
committed
Merge pull request #166 from cold147/hosts-on-docker
fix: move hosts file inside the docker container #136
2 parents 8f6ed73 + c8af029 commit a5f69d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/vagrant-hostmanager/hosts_file/updater.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def update_guest(machine)
3838
machine.communicate.upload(file, '/tmp/hosts')
3939
if windir
4040
machine.communicate.sudo("#{move_cmd} /tmp/hosts/hosts.#{machine.name} #{realhostfile}")
41+
elsif machine.communicate.test('test -f /.dockerinit')
42+
machine.communicate.sudo("cat /tmp/hosts > #{realhostfile}")
4143
else
4244
machine.communicate.sudo("#{move_cmd} /tmp/hosts #{realhostfile}")
4345
end

0 commit comments

Comments
 (0)