Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Improve Vagrant Remote Docker Host Support #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "digest/md5"
require "fileutils"
require "thread"
require "uri"

require "log4r"

Expand Down Expand Up @@ -136,6 +137,17 @@ def host_vm?
end
end

# This checks whether the host system is configured to talk to a remote
# docker host by inspecting the `DOCKER_HOST` env var.
def remote_docker_host?
!ENV['DOCKER_HOST'].to_s.strip.empty?
end

# Returns the host part from the `DOCKER_HOST` env var
def remote_docker_host
URI.parse(ENV['DOCKER_HOST']).host
end

# Returns the forwarded SSH port on the host. If no port forwarding
# for "ssh" is found we return nil
def forwarded_ssh_host_port
Expand Down