guests/coreos: docker_daemon_running cap [GH-3425]

This commit is contained in:
Mitchell Hashimoto 2014-04-10 13:42:12 -07:00
parent 541ebd8935
commit f47213f9b2
7 changed files with 53 additions and 1 deletions

View File

@ -18,6 +18,7 @@ BUG FIXES:
- commands/package: Nice error if includes contain symlinks. [GH-3200] - commands/package: Nice error if includes contain symlinks. [GH-3200]
- commands/rsync-auto: Don't crash if the machine can't be communicated - commands/rsync-auto: Don't crash if the machine can't be communicated
to. [GH-3419] to. [GH-3419]
- guests/coreos: Docker provisioner works. [GH-3425]
- guests/fedora: Fix hostname setting. [GH-3382] - guests/fedora: Fix hostname setting. [GH-3382]
- guests/fedora: Support predictable network interface names for - guests/fedora: Support predictable network interface names for
public/private networks. [GH-3207] public/private networks. [GH-3207]

View File

@ -0,0 +1,11 @@
module VagrantPlugins
module GuestCoreOS
module Cap
module Docker
def self.docker_daemon_running(machine)
machine.communicate.test("test -f /run/docker.sock")
end
end
end
end
end

View File

@ -20,6 +20,11 @@ module VagrantPlugins
require_relative "cap/configure_networks" require_relative "cap/configure_networks"
Cap::ConfigureNetworks Cap::ConfigureNetworks
end end
guest_capability("coreos", "docker_daemon_running") do
require_relative "cap/docker"
Cap::Docker
end
end end
end end
end end

View File

@ -0,0 +1,17 @@
module VagrantPlugins
module DockerProvider
module Action
# This action is responsible for creating the host machine if
# we need to.
class HostMachine
def initialize(app, env)
@app = app
end
def call(env)
@app.call(env)
end
end
end
end
end

View File

@ -0,0 +1,13 @@
module VagrantPlugins
module Docker
module Cap
module Linux
module DockerDaemonRunning
def self.docker_daemon_running(machine)
machine.communicate.test("test -f /var/run/docker/pid")
end
end
end
end
end
end

View File

@ -32,7 +32,7 @@ module VagrantPlugins
end end
def daemon_running? def daemon_running?
@machine.communicate.test('test -f /var/run/docker.pid') @machine.guest.capability(:docker_daemon_running)
end end
def run(containers) def run(containers)

View File

@ -54,6 +54,11 @@ module VagrantPlugins
Cap::Linux::DockerConfigureVagrantUser Cap::Linux::DockerConfigureVagrantUser
end end
guest_capability("linux", "docker_daemon_running") do
require_relative "cap/linux/docker_daemon_running"
Cap::Linux::DockerDaemonRunning
end
provisioner(:docker) do provisioner(:docker) do
require_relative "provisioner" require_relative "provisioner"
Provisioner Provisioner