Sha256: be13414193c362086cc34d13dc325c215bd5f5683566082eb9d6adf323e22991

Contents?: true

Size: 713 Bytes

Versions: 1

Compression:

Stored size: 713 Bytes

Contents

module VagrantPlugins
  module DockerProvider
    class SyncedFolder < Vagrant.plugin("2", :synced_folder)
      def usable?(machine)
        # These synced folders only work if the provider is Docker
        machine.provider_name == :docker
      end

      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
docker-provider-0.1.0 lib/docker-provider/synced_folder.rb