Skip to content
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