Class: VagrantPlugins::DockerProvider::SyncedFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/docker-provider/synced_folder.rb

Instance Method Summary collapse

Instance Method Details

#prepare(machine, folders, _opts) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/docker-provider/synced_folder.rb', line 9

def prepare(machine, folders, _opts)
  # FIXME: Check whether the container has already been created with
  #        different synced folders and let the user know about it
  folders.each do |id, data|
    host_path  = File.expand_path(data[:hostpath], machine.env.root_path)
    guest_path = data[:guestpath]
    machine.provider_config.volumes << "#{host_path}:#{guest_path}"
  end
end

#usable?(machine) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/docker-provider/synced_folder.rb', line 4

def usable?(machine)
  # These synced folders only work if the provider is Docker
  machine.provider_name == :docker
end