2014-03-26 23:45:46 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module DockerProvider
|
2014-03-27 00:04:15 +00:00
|
|
|
autoload :Action, File.expand_path("../action", __FILE__)
|
|
|
|
autoload :Driver, File.expand_path("../driver", __FILE__)
|
|
|
|
autoload :Errors, File.expand_path("../errors", __FILE__)
|
|
|
|
|
2014-04-11 01:26:19 +00:00
|
|
|
module Executor
|
|
|
|
autoload :Local, File.expand_path("../executor/local", __FILE__)
|
|
|
|
autoload :Vagrant, File.expand_path("../executor/vagrant", __FILE__)
|
|
|
|
end
|
|
|
|
|
2014-03-26 23:45:46 +00:00
|
|
|
class Plugin < Vagrant.plugin("2")
|
|
|
|
name "docker-provider"
|
2014-03-27 00:04:35 +00:00
|
|
|
description <<-EOF
|
|
|
|
The Docker provider allows Vagrant to manage and control
|
|
|
|
Docker containers.
|
|
|
|
EOF
|
2014-03-26 23:45:46 +00:00
|
|
|
|
2014-05-09 23:02:09 +00:00
|
|
|
provider(:docker, box_optional: true, parallel: true, defaultable: false) do
|
2014-03-26 23:45:46 +00:00
|
|
|
require_relative 'provider'
|
2014-03-27 00:01:34 +00:00
|
|
|
init!
|
2014-03-26 23:45:46 +00:00
|
|
|
Provider
|
|
|
|
end
|
|
|
|
|
2014-04-16 00:25:39 +00:00
|
|
|
command("docker-logs", primary: false) do
|
|
|
|
require_relative "command/logs"
|
2014-04-16 00:23:56 +00:00
|
|
|
init!
|
2014-04-16 00:25:39 +00:00
|
|
|
Command::Logs
|
2014-04-16 00:23:56 +00:00
|
|
|
end
|
|
|
|
|
2014-04-28 01:10:41 +00:00
|
|
|
command("docker-run", primary: false) do
|
|
|
|
require_relative "command/run"
|
|
|
|
init!
|
|
|
|
Command::Run
|
|
|
|
end
|
|
|
|
|
2014-04-16 03:52:06 +00:00
|
|
|
communicator(:docker_hostvm) do
|
|
|
|
require_relative "communicator"
|
|
|
|
init!
|
|
|
|
Communicator
|
|
|
|
end
|
|
|
|
|
2014-03-26 23:45:46 +00:00
|
|
|
config(:docker, :provider) do
|
|
|
|
require_relative 'config'
|
2014-03-27 00:01:34 +00:00
|
|
|
init!
|
2014-03-26 23:45:46 +00:00
|
|
|
Config
|
|
|
|
end
|
|
|
|
|
|
|
|
synced_folder(:docker) do
|
|
|
|
require File.expand_path("../synced_folder", __FILE__)
|
|
|
|
SyncedFolder
|
|
|
|
end
|
2014-03-27 00:01:34 +00:00
|
|
|
|
2014-03-28 00:10:48 +00:00
|
|
|
provider_capability("docker", "public_address") do
|
|
|
|
require_relative "cap/public_address"
|
|
|
|
Cap::PublicAddress
|
|
|
|
end
|
|
|
|
|
2014-10-22 23:17:13 +00:00
|
|
|
provider_capability("docker", "proxy_machine") do
|
|
|
|
require_relative "cap/proxy_machine"
|
|
|
|
Cap::ProxyMachine
|
|
|
|
end
|
|
|
|
|
2014-03-27 00:01:34 +00:00
|
|
|
protected
|
|
|
|
|
|
|
|
def self.init!
|
|
|
|
return if defined?(@_init)
|
|
|
|
I18n.load_path << File.expand_path(
|
|
|
|
"templates/locales/providers_docker.yml", Vagrant.source_root)
|
|
|
|
I18n.reload!
|
|
|
|
@_init = true
|
|
|
|
end
|
2014-03-26 23:45:46 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|